Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dispatchRemoveAction: false by default.
  • Loading branch information
prescottprue committed Oct 29, 2017
commit cec092ab3eedef534f495edfe2b5863371d4f82e
7 changes: 4 additions & 3 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ export const actionTypes = {
* dispatch UNSET_LISTENER when disabling listeners for a specific path. USE WITH CAUTION
* Setting this to true allows an action to be called that removes data
* from redux (which might not always be expected).
* @property {Boolean} dispatchRemoveAction - `true` Whether or not to
* dispatch REMOVE action when calling `remove`.
* @property {Boolean} dispatchRemoveAction - `false` Whether or not to
* dispatch REMOVE action when calling `remove`. **NOTE** Causes two state
* updates if a listener is affected by your remove call.
* @property {String} firebaseStateName - 'firebase' Assumed name of Firebase
* state (name given when passing reducer to combineReducers). Used in
* firebaseAuthIsReady promise (see
Expand All @@ -179,7 +180,7 @@ export const defaultConfig = {
autoPopulateProfile: false,
setProfilePopulateResults: false,
dispatchOnUnsetListener: true,
dispatchRemoveAction: true,
dispatchRemoveAction: false,
enableEmptyAuthChanges: true,
firebaseStateName: 'firebase',
attachAuthIsReady: false
Expand Down
5 changes: 4 additions & 1 deletion src/createFirebaseInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ export const createFirebaseInstance = (firebase, configs, dispatch) => {
withMeta('update', path, value, onComplete)

/**
* @description Removes data from Firebase at a given path.
* @description Removes data from Firebase at a given path. **NOTE** A
* seperate action is not dispatched unless `dispatchRemoveAction: true` is
* provided to config on store creation. That means that a listener must
* be attached in order for state to be updated when calling remove.
* @param {String} path - Path to location on Firebase which to remove
* @param {Function} onComplete - Function to run on complete (`not required`)
* @return {Promise} Containing reference snapshot
Expand Down