I'm working on a project that uses watch queries intensively and I'm very excited about how good it works! However, I'm constantly running into problems because watch query results are updated "too fast", for example:
I have a component that is only displayed when property foo is true. This property is fetched by a parent component via watchQuery. Now the component has an action that sets this property to false via a mutation and then transitions to another route. Now if we call that action, it will never reach the transition because the component is destroyed.
This issue could be fixed very easily if we update the changes in the cache in the next runloop:
I'm working on a project that uses watch queries intensively and I'm very excited about how good it works! However, I'm constantly running into problems because watch query results are updated "too fast", for example:
I have a component that is only displayed when property
foo
istrue
. This property is fetched by a parent component viawatchQuery
. Now the component has an action that sets this property tofalse
via a mutation and then transitions to another route. Now if we call that action, it will never reach the transition because the component is destroyed.This issue could be fixed very easily if we update the changes in the cache in the next runloop:
https://github.com/ember-graphql/ember-apollo-client/blob/b1b558d10be2463a77780ce7f88435bd12975e38/addon/services/apollo.js#L108-L112
If we use
next
instead ofrun
this problem would be fixed.Is there anything that speaks against this? How does
ember-data
do this?