1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-28 14:16:41 +07:00

added recent to reducer

This commit is contained in:
Fedor Katurov 2019-10-28 18:26:12 +07:00
parent 920a8adaa2
commit 746d10ce8b
8 changed files with 38 additions and 9 deletions

View file

@ -1,6 +1,6 @@
import assocPath from 'ramda/es/assocPath';
import { FLOW_ACTIONS } from './constants';
import { flowSetNodes, flowSetHeroes } from './actions';
import { flowSetNodes, flowSetHeroes, flowSetRecent } from './actions';
import { IFlowState } from './reducer';
const setNodes = (state: IFlowState, { nodes }: ReturnType<typeof flowSetNodes>) =>
@ -9,7 +9,11 @@ const setNodes = (state: IFlowState, { nodes }: ReturnType<typeof flowSetNodes>)
const setHeroes = (state: IFlowState, { heroes }: ReturnType<typeof flowSetHeroes>) =>
assocPath(['heroes'], heroes, state);
const setRecent = (state: IFlowState, { recent }: ReturnType<typeof flowSetRecent>) =>
assocPath(['recent'], recent, state);
export const FLOW_HANDLERS = {
[FLOW_ACTIONS.SET_NODES]: setNodes,
[FLOW_ACTIONS.SET_HEROES]: setHeroes,
[FLOW_ACTIONS.SET_RECENT]: setRecent,
};