Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Created November 22, 2018 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverJAsh/ac163485a894390469d73019ae4a058c to your computer and use it in GitHub Desktop.
Save OliverJAsh/ac163485a894390469d73019ae4a058c to your computer and use it in GitHub Desktop.
const rootEpic: Epic<Action, Action, State> = (
action$,
state$
) => {
const counterStates$ = state$.map(
state => state.counterStates
);
// Given a list and an epic for each list item, return an
// Observable of the actions for all list items.
const counterStateAction$ = counterStates$.pipe(
runListEpics({
action$,
listItemEpic: counterEpic,
getListItemKey: counterState => counterState.id,
selectListItem: getCounterState
})
);
return counterStateAction$;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment