Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Resolve GitHub issue #64: "Maintain a list of frontend grid sizes and export them" #71

Merged
merged 2 commits into from
Jun 20, 2017
Merged

Resolve GitHub issue #64: "Maintain a list of frontend grid sizes and export them" #71

merged 2 commits into from
Jun 20, 2017

Conversation

cactysman
Copy link
Contributor

@cactysman cactysman commented Jun 9, 2017

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.

*/
public static get gridLayoutSizes(): IGridLayout[] {
return {...InteractiveConstants._gridLayoutSizes};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use Object.freeze for the same effect, which returns a ReadOnlyArray for compile-time enforcement for immutability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohhh, right, why didn't I think of that ...
I'll improve that once I'm home 😬

* Offers constant information values to use in an application.
*/
export class InteractiveConstants {
private static readonly _gridLayoutSizes: IGridLayout[] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be a class?

Could it be a module instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Checkout InteractiveError in errors.ts for an example of a module.

Metaa added 2 commits June 19, 2017 20:11
-> "Maintain a list of frontend grid sizes and export them"
…y readonly

(also sorted modules in index.ts by the alphabet)
@cactysman cactysman changed the title Resolve GitHub issue #64 Resolve GitHub issue #64: "Maintain a list of frontend grid sizes and export them" Jun 19, 2017
/**
* Offers constant information values to use in an application.
*/
export module InteractiveConstants {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for wrapping this inside of a module?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where else could you place such information? 🤔 As a static method in Scenes?
Also that way other constants for stuff could be grouped.

Copy link
Contributor

Choose a reason for hiding this comment

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

The file is already called constants why not just export it directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@SimonSchick SimonSchick Jun 20, 2017

Choose a reason for hiding this comment

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

We don't really use modules to wrap things up anywhere in TS, namespaces maybe, but not modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, feel free to change it then!
I won't be able to for the next two weeks.

Copy link
Contributor

Choose a reason for hiding this comment

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

I will merge and change it after.

@SimonSchick SimonSchick merged commit 4f9f61d into mixer:master Jun 20, 2017
@cactysman cactysman deleted the enhancement-gridsizes branch August 31, 2018 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants