Resolve GitHub issue #64: "Maintain a list of frontend grid sizes and export them"#71
Resolve GitHub issue #64: "Maintain a list of frontend grid sizes and export them"#71SimonSchick merged 2 commits intomixer:masterfrom cactysman:enhancement-gridsizes
Conversation
src/InteractiveConstants.ts
Outdated
| */ | ||
| public static get gridLayoutSizes(): IGridLayout[] { | ||
| return {...InteractiveConstants._gridLayoutSizes}; | ||
| } |
There was a problem hiding this comment.
You can use Object.freeze for the same effect, which returns a ReadOnlyArray for compile-time enforcement for immutability.
There was a problem hiding this comment.
Ohhh, right, why didn't I think of that ...
I'll improve that once I'm home 😬
src/InteractiveConstants.ts
Outdated
| * Offers constant information values to use in an application. | ||
| */ | ||
| export class InteractiveConstants { | ||
| private static readonly _gridLayoutSizes: IGridLayout[] = [ |
There was a problem hiding this comment.
Does this need to be a class?
Could it be a module instead?
There was a problem hiding this comment.
Checkout InteractiveError in errors.ts for an example of a module.
-> "Maintain a list of frontend grid sizes and export them"
…y readonly (also sorted modules in index.ts by the alphabet)
| /** | ||
| * Offers constant information values to use in an application. | ||
| */ | ||
| export module InteractiveConstants { |
There was a problem hiding this comment.
What is the reason for wrapping this inside of a module?
There was a problem hiding this comment.
Where else could you place such information? 🤔 As a static method in Scenes?
Also that way other constants for stuff could be grouped.
There was a problem hiding this comment.
The file is already called constants why not just export it directly?
There was a problem hiding this comment.
I figured that if there's more constants stuff to be exported in the future, you'd wanna wrap it anyways 😊
Makes it a bit cleaner in my opinion.
There was a problem hiding this comment.
We don't really use modules to wrap things up anywhere in TS, namespaces maybe, but not modules.
There was a problem hiding this comment.
Alright, feel free to change it then!
I won't be able to for the next two weeks.
There was a problem hiding this comment.
I will merge and change it after.
This is an attempt to resolve issue #64 "Maintain a list of frontend grid sizes and export them".
I'm not sure if the method of how this is implemented is the best way, but I think it's okay.
I made it so that the information exported cannot be overridden.