-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Collection.docs briefly reflects old documents when source changed #19
Comments
Hi Ken, thanks for reporting this. This is an interesting case. In case of changing the source, I can indeed imagine that the documents array is cleared. |
Your description is accurate. I'll take a look at the Collection.isLoading prop you've added and see if that clears up the error from #18. |
Using isLoading is working fine, I can't reproduce #18 anymore so this is no longer an issue. Aside, this project is fantastic neat and I'm having a lot of fun playing with it. Thanks for your efforts here! Once I get my head really wrapped around mobx I'll try to help out. |
Great to hear, let me know if you need any help and looking forward to contributions 😃 |
I've noticed when changing the path on a collection in a component's constructor that React will render the old docs then rerender the new set once _updateFromSnapshot completes.
I tried avoiding this flash of stale data by rendering a loading indicator using Collection.fetching but I pretty consistently encounter #18 with that approach.
Would it make sense to proactively clear the _docs array in
set source()
?The text was updated successfully, but these errors were encountered: