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

Improve how changing props is handled #4

Open
stevesims opened this issue Nov 5, 2018 · 1 comment
Open

Improve how changing props is handled #4

stevesims opened this issue Nov 5, 2018 · 1 comment

Comments

@stevesims
Copy link
Owner

Changing props will cause new fetches to be initiated. If that happens whilst a fetch is already in progress things can get a little confusing, as the flags will get updated when the first fetch finishes, and thus will show that the fetch has completed when there's actually fetches in progress.

If props change multiple times whilst a fetch is already happening then the problem just gets a bit worse - plus the interim changes do not necessarily need to be seen.

@stevesims
Copy link
Owner Author

stevesims commented Nov 5, 2018

Some ideas for potential solutions to this.

  1. a queue could be made of pending fetches. Only when the queue is empty should the isFetching flag be cleared
  2. a flag could be set to indicate that a props have changed and data should be re-fetched, if there is currently a fetch in progress. This flag could be currentFetchStale

If possible we could/should abort a fetch before initiating a new one

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