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

This is vaguely related to #89 #91

Open
Gozala opened this issue Mar 11, 2015 · 1 comment
Open

This is vaguely related to #89 #91

Gozala opened this issue Mar 11, 2015 · 1 comment

Comments

@Gozala
Copy link
Contributor

Gozala commented Mar 11, 2015

In nutshell problem is that if in response to some event async computation was scheduled (for example XHR to the server) on completion of which I intend to update cursor passed into a render, it could be that cursor is no longer pointing to a right thing)

For example consider this scenario:

  • render is passed some cursor to render & update.
  • Event listener is set on the returned DOM (let's say 'change' event on input field)
  • Event listener does lookup in XHR / or access indexed DB to fetch data related to input.
  • When response is back cursor is updated with a response data.

If cursor ._keyPath got updated or if data that cursor was pointing to got removed your response handler will end up either updating wrong data structure (that currently matches that _keyPath) or will bring back the removed data structure where it used to be.

@Gozala
Copy link
Contributor Author

Gozala commented Mar 11, 2015

Now #89 is responsible for updates to a data structure, that could be solve there. Although it is still unclear how current API could be used with async tasks that complete after an update to the component that initiated them. To put it differently some tasks may need to be aborted, or it's results need to be discarded (when abort isn't possible) if some other update makes them irrelevant (like if component was remove from the tree by the time response is received).

Of course one could use mixins to deal with that, but it seems to me there should be another way.

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

1 participant