import { IAction } from 'types' ; export const initAttributesMap = ( responseAttributes ) : IAction => { const attributesMap = { } ; for ( const attr of responseAttributes ) { attributesMap [ attr . path ] = attr ; } return { type : 'INIT_ATTRIBUTES_MAP' , payload : { ... attributesMap } } ; } ; export const setAttributeInMap = ( path , attr ) : IAction => { return { type : 'SET_ATTRIBUTE_IN_MAP' , payload : { path , attr } } ; } ; export const removeAttributesFromMap = ( pathStart ) : IAction => { return { type : 'REMOVE_ATTRIBUTES_FROM_MAP' , payload : { pathStart } } ; } ;