Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Add Quarter entity#52

Merged
akiomik merged 1 commit intodevelopmentfrom
add-quarter
Nov 15, 2021
Merged

Add Quarter entity#52
akiomik merged 1 commit intodevelopmentfrom
add-quarter

Conversation

@akiomik
Copy link
Copy Markdown
Contributor

@akiomik akiomik commented Nov 13, 2021

No description provided.

@akiomik akiomik requested a review from shoe116 November 13, 2021 02:11
@akiomik akiomik self-assigned this Nov 13, 2021

test('(uncached)', () => {
expect(QuarterCache.get(ticker, period.toYearQuarter())).toBeNull()
expect(QuarterCache.getData(ticker, period.toYearQuarter())).toBeNull()
Copy link
Copy Markdown
Contributor Author

@akiomik akiomik Nov 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2の既存のコードは、キャッシュの取得時は QuarterCache.get だったのを QuarterCache.getData に、設定時は QuarterCache.put だったのを QuarterCache.putData に変更すれば同じ挙動で動くようになります

return `${this.prefix}-column-description`
}

static getData(ticker: string, yearQuarter: YearQuarter): object | null {
Copy link
Copy Markdown
Contributor Author

@akiomik akiomik Nov 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

キャッシュの取得ロジックはメソッド名が変わっただけでコード自体の変更はないため、v2では変更後の名前に修正すれば挙動は変わりません。

return new Quarter(cachedData, cachedColumnDescription)
}

static putData(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

キャッシュの設定時も同様です。

Copy link
Copy Markdown
Contributor

@shoe116 shoe116 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • もともとあった get put の挙動を変更
  • getData putData は変更前の get put と同じ挙動で、互換はそれでとる

ってことだよね。LGTM です

@akiomik akiomik merged commit a121126 into development Nov 15, 2021
@akiomik akiomik mentioned this pull request Nov 19, 2021
@t2h5 t2h5 deleted the add-quarter branch November 7, 2022 09:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants