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

NodeLayout

This commit is contained in:
muerwre 2019-08-25 16:10:46 +07:00
parent 684a4f4474
commit b154277de8
23 changed files with 332 additions and 65 deletions

View file

@ -1,10 +1,14 @@
import assocPath from 'ramda/es/assocPath';
import { NODE_ACTIONS } from './constants';
import { nodeSetSaveErrors } from './actions';
import { nodeSetSaveErrors, nodeSetLoading } from './actions';
import { INodeState } from './reducer';
const setSaveErrors = (state: INodeState, { errors }: ReturnType<typeof nodeSetSaveErrors>) => assocPath(['errors'], errors, state);
const setSaveErrors = (state: INodeState, { errors }: ReturnType<typeof nodeSetSaveErrors>) =>
assocPath(['errors'], errors, state);
const setLoading = (state: INodeState, { is_loading }: ReturnType<typeof nodeSetLoading>) =>
assocPath(['is_loading'], is_loading, state);
export const NODE_HANDLERS = {
[NODE_ACTIONS.SAVE]: setSaveErrors,
[NODE_ACTIONS.SET_LOADING]: setLoading,
};