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
Hi! Having fun experimenting with Marty, thanks for making it! But I ran into something I haven't been able to figure out...
According to the Store docs, I can pass a dependsOn option to fetch() which is a dependency fetchResult or array of fetchResults. This way "It will only try and start fetching the data when all dependencies are done."
When I try to do this, the dependency fetch works and gets resolved correctly, but the "parent" fetch (the one with dependsOn) does not seem to ever finish fetching after the dependency is finished - it has a permanent PENDING state. If I wait until the dependency is done and then try the original fetch again, it does get resolved - but this of course defeats the purpose because I have to know when the dependency is done.
I tried stepping through the code but I don't fully understand fetchResult yet... Any ideas? I put together a contrived example in this Gist: https://gist.github.com/dandelany/abac7290bce588f9a709 In the example, FriendStore.getAll() depends on UserStore.getAll(). UserStore.getAll() finishes and has a state of "DONE" but FriendStore is still "PENDING".
The text was updated successfully, but these errors were encountered:
Hey, the problem is the state mixin was only bound to the friend store so the component wouldn't re-render when the user store re-renders. This fiddle shows a working example.
That said I think this is a missing feature in Marty. The Friend store should emit a change when any dependent fetches are complete. I will try and implement that over the next few days
Hi! Having fun experimenting with Marty, thanks for making it! But I ran into something I haven't been able to figure out...
According to the Store docs, I can pass a
dependsOn
option to fetch() which is a dependency fetchResult or array of fetchResults. This way "It will only try and start fetching the data when all dependencies are done."When I try to do this, the dependency fetch works and gets resolved correctly, but the "parent" fetch (the one with dependsOn) does not seem to ever finish fetching after the dependency is finished - it has a permanent PENDING state. If I wait until the dependency is done and then try the original fetch again, it does get resolved - but this of course defeats the purpose because I have to know when the dependency is done.
I tried stepping through the code but I don't fully understand fetchResult yet... Any ideas? I put together a contrived example in this Gist: https://gist.github.com/dandelany/abac7290bce588f9a709 In the example, FriendStore.getAll() depends on UserStore.getAll(). UserStore.getAll() finishes and has a state of "DONE" but FriendStore is still "PENDING".
The text was updated successfully, but these errors were encountered: