Skip to content

Commit 48c677d

Browse files
fej-snikdujprescottprue
authored andcommitted
fix(listeners): correctly unwatch multiple queries to the same base path (prescottprue#235)
* Correctly unset multiple queries to the same base path 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.
1 parent aa8d75b commit 48c677d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-redux-firebase",
3-
"version": "1.4.5",
3+
"version": "1.4.6",
44
"description": "Redux integration for Firebase. Comes with a Higher Order Component for use with React.",
55
"browser": "dist/react-redux-firebase.js",
66
"main": "lib/index.js",

src/actions/query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export const watchEvents = (firebase, dispatch, events) =>
193193
*/
194194
export const unWatchEvents = (firebase, dispatch, events) =>
195195
events.forEach(event =>
196-
unWatchEvent(firebase, dispatch, event.type, event.path)
196+
unWatchEvent(firebase, dispatch, event.type, event.path, event.queryId)
197197
)
198198

199199
export default { watchEvents, unWatchEvents }

0 commit comments

Comments
 (0)