Skip to content

Correctly unwatch multiple queries to the same base path. #235

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

Merged
merged 2 commits into from
Aug 15, 2017
Merged

Correctly unwatch multiple queries to the same base path. #235

merged 2 commits into from
Aug 15, 2017

Conversation

fej-snikduj
Copy link
Collaborator

@fej-snikduj fej-snikduj commented Aug 14, 2017

Description

When multiple listeners are set on the same path with different query parameters, all of the paths are not correctly unwatched when the component unmounts.

Passing queryId into the unWatchEvent function is necessary for
unique queries on the same base path to be properly identified when
unwatching events. getQueryIdFromPath and getWatchPath do not
correctly identify unique queries at the same path (because the path
that is passed into these functions is the path without query strings
attached). This scenario happens when using storeAs functionality.

Check List

If not relevant to pull request, check off as complete

  • [X ] All tests passing (except one test that was failing prior to this PR)
  • [NA] Docs updated with any changes or examples if applicable
  • [NA ] Added tests to ensure new feature(s) work properly

Relevant Issues

Closes #234

Passing queryId allows into the unWatchEvent function is necessary for
unique queries to the same base path to be properly identified when
unwatching events..  getQueryIdFromPath and getWatchPath do not
correctly identify unique queries at the same path (because the path
that is passed into these functions is the path without query strings
attached).  This scenario happens when using storeAs functionality.
@prescottprue
Copy link
Owner

Thanks! Tests don't pass, but it seems like an easy fix that we can handle later.

Will release it tonight.

@prescottprue prescottprue merged commit 48c677d into prescottprue:master Aug 15, 2017
prescottprue pushed a commit that referenced this pull request Aug 15, 2017
* Correctly unset multiple queries to the same base path - #234, #235
* Fix peer dependency warning from `eslint-config-standard` (updated
`eslint-plugin-standard` to 3.0.1)
* Define initialState in example within Readme - #233
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.

2 participants