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

[Maps] Mark instance variables as readonly #59695

Closed
thomasneirynck opened this issue Mar 9, 2020 · 1 comment · Fixed by #60557
Closed

[Maps] Mark instance variables as readonly #59695

thomasneirynck opened this issue Mar 9, 2020 · 1 comment · Fixed by #60557
Assignees
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.7.0 v8.0.0

Comments

@thomasneirynck
Copy link
Contributor

thomasneirynck commented Mar 9, 2020

All instance-variables in Maps under layers/**/*.ts should be marked as readonly.

The current architecture of Maps expects it:

  • all state needs to be represented in the redux store
  • there's only private instance-state, since all public access is mediated through methods on the interface.

This is now implicitly enforced through code reviews.

By using the readonly keyword, we can make this explicit and enforce it at compile-time.

This is for typescript code only.

@thomasneirynck thomasneirynck added chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.7.0 labels Mar 9, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@thomasneirynck thomasneirynck changed the title [Maps] mark instance variables as readonly [Maps] Mark instance variables as readonly Mar 9, 2020
@thomasneirynck thomasneirynck self-assigned this Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants