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

Expected behavior from update #20

Open
meandavejustice opened this issue Jul 19, 2015 · 1 comment
Open

Expected behavior from update #20

meandavejustice opened this issue Jul 19, 2015 · 1 comment

Comments

@meandavejustice
Copy link

Initial thoughts for usage of loop.update({key: value}) were that it would match setState in React.

Here we set the entire state object to the object passed to update, whereas in React we only set the key passed to setState.
I am currently working around this with xtend

wave.loop.update(xtend(state, {moving: false}))

What are your thoughts are matching the setState behavior?

@Raynos
Copy link
Owner

Raynos commented Jul 19, 2015

👎 main-loop simply passes the entire state around.

It's only a small part of the solution, you need some kind of library to manage data structures.

What you really want to do is use some kind of immutable or observable data structure. See how mercury interacts with main-loop.

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

2 participants