Skip to content
Merged
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
Remove unused utility function.
  • Loading branch information
prescottprue committed Jan 16, 2018
commit f2cb23cff68783bff5fc5b94db19417f45eb4b7f
18 changes: 0 additions & 18 deletions src/utils/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,3 @@ export const mapWithFirebaseAndDispatch = (firebase, dispatch, actions, aliases
}), {})
}
}

/**
* Map each action with Firebase and Dispatch. Includes aliasing of actions.
* @param {Object} firebase - Internal firebase instance
* @param {Function} dispatch - Redux's dispatch function
* @param {Object} actions - Action functions to map with firebase and dispatch
* @return {Object} Actions mapped with firebase and dispatch
*/
export const mapWithDispatchAndFirebase = (dispatch, firebase, actions, aliases = []) => {
const withDispatchAndFirebase = createWithFirebaseAndDispatch(firebase, dispatch, true)
return {
...mapValues(actions, withDispatchAndFirebase),
...aliases.reduce((acc, { action, name }) => ({
...acc,
[name]: withDispatchAndFirebase(action)
}), {})
}
}