mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
added updated nodes to flow
This commit is contained in:
parent
6f76bec2c0
commit
74cd181530
13 changed files with 128 additions and 30 deletions
|
@ -1,6 +1,6 @@
|
|||
import assocPath from 'ramda/es/assocPath';
|
||||
import { FLOW_ACTIONS } from './constants';
|
||||
import { flowSetNodes, flowSetHeroes, flowSetRecent } from './actions';
|
||||
import { flowSetNodes, flowSetHeroes, flowSetRecent, flowSetUpdated } from './actions';
|
||||
import { IFlowState } from './reducer';
|
||||
|
||||
const setNodes = (state: IFlowState, { nodes }: ReturnType<typeof flowSetNodes>) =>
|
||||
|
@ -12,8 +12,12 @@ const setHeroes = (state: IFlowState, { heroes }: ReturnType<typeof flowSetHeroe
|
|||
const setRecent = (state: IFlowState, { recent }: ReturnType<typeof flowSetRecent>) =>
|
||||
assocPath(['recent'], recent, state);
|
||||
|
||||
const setUpdated = (state: IFlowState, { updated }: ReturnType<typeof flowSetUpdated>) =>
|
||||
assocPath(['updated'], updated, state);
|
||||
|
||||
export const FLOW_HANDLERS = {
|
||||
[FLOW_ACTIONS.SET_NODES]: setNodes,
|
||||
[FLOW_ACTIONS.SET_HEROES]: setHeroes,
|
||||
[FLOW_ACTIONS.SET_RECENT]: setRecent,
|
||||
[FLOW_ACTIONS.SET_UPDATED]: setUpdated,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue