You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 somecursor
to render & update.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.The text was updated successfully, but these errors were encountered: