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

Array and Map #56

Closed
hansagames opened this issue Feb 3, 2020 · 3 comments
Closed

Array and Map #56

hansagames opened this issue Feb 3, 2020 · 3 comments

Comments

@hansagames
Copy link

How to use Array and Map inside Model?

@:editable var aviableLanguages:Array<String> = [];

this code gives me error that its not Observable, right now silenced it with @:skipCheck, but don't feel that is best option.

Thank you

@back2dos
Copy link
Member

back2dos commented Feb 4, 2020

There are two options:

  1. Use tink.state.ObservableArray and tink.state.ObservableMap. This mostly works like a plain array, except that mutations are observable.
  2. Use tink.pure.List/tink.pure.Slice and tink.pure.Mapping. These are immutable.

@back2dos back2dos closed this as completed Feb 4, 2020
@kevinresol
Copy link
Member

Perhaps we should typedef these coconut-compatible data structures? So that people doesn't need to care about the underlying libraries (tink_state/tink_pure)

@hansagames
Copy link
Author

@back2dos thank you for answer

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