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

Unique promise keeper instance per store #19

Merged
merged 1 commit into from Jun 19, 2020
Merged

Conversation

kinetifex
Copy link
Contributor

This solves an issue where debouncing can occur erroneously for fetches to the same endpoint, but for different stores. An example of when this could occur is if used during server-side rendering, multiple users request pages that fetch details from the same endpoint URL.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 87

  • 6 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 79: 0.0%
Covered Lines: 161
Relevant Lines: 161

💛 - Coveralls

*/
export function getPromiseKeeper(dispatch) {
if (!_promiseKeepers.has(dispatch)) {
_promiseKeepers.set(dispatch, new PromiseKeeper());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever way to differentiate stores!

@kinetifex kinetifex merged commit c9b810b into master Jun 19, 2020
@kinetifex kinetifex deleted the fix-ssr-issue branch June 19, 2020 20:03
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

Successfully merging this pull request may close these issues.

None yet

3 participants