Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
add a groupByActionTypes helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
davidroeca committed May 10, 2017
1 parent d4179d0 commit 2b2ad23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ export function combineFilters (...filters) {
curr(action, currentState, previousHistory)
, () => true)
}

export function groupByActionTypes (rawActions) {
const actions = parseActions(rawActions)
return (action) => actions.indexOf(action.type) >= 0 ? action.type : null
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { ActionTypes, ActionCreators } from './actions'
export {
parseActions, isHistory,
distinctState, includeAction, excludeAction,
combineFilters
combineFilters, groupByActionTypes
} from './helpers'

export { default } from './reducer'

0 comments on commit 2b2ad23

Please sign in to comment.