Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configとcurrentConfig #231

Open
mikihiro-t opened this issue Dec 4, 2023 · 2 comments
Open

configとcurrentConfig #231

mikihiro-t opened this issue Dec 4, 2023 · 2 comments
Assignees

Comments

@mikihiro-t
Copy link

.NET版で、config周辺のコードを作成している途中です。
分からない点がありますので、教えて頂けるとありがたいです。

normalize.tsで、
export const config: Config = currentConfig
となっているので、configとcurrentConfigは同じインスタンスという理解で良いでしょうか?
すると、

currentConfig.interfaceVersion === 2
currentConfig.interfaceVersion === 1

となっていますが、
config.interfaceVersion
としないのは、何か意図があるのでしょうか?

@kamataryo kamataryo self-assigned this Dec 5, 2023
@kamataryo
Copy link
Contributor

@mikihiro-t こんにちは、ご質問いただきありがとうございます。
こちら、4d778a9 で追加したコミットで、 config と currentConfig を明確に使い分けていたわけではないと記憶しています。まだ α 版状態の機能で、コード自体も、何らかの挙動を意図してそうしているわけではないかと思われます。

config と currentConfig は同じインスタンス(オブジェクト)を指しているものとご理解いただいて問題ないかと思います。

@mikihiro-t
Copy link
Author

参考になりました。ありがとうございます。
.NETのコードでは、CurrentConfigに統一するとわかりやすい感もしますが、TypeScriptのオリジナルに準拠することにしました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@kamataryo @mikihiro-t and others