export function createAction < T extends ActionType > ( type , payload ) { return { type , payload , } ; } ; export function createActionCreator < T extends ActionType > ( type ) { return ( payload ) => createAction < T > ( type , payload ) ; } ; export function handleActions < Key extends StoreKey > ( map , defaultState ) { return ( state , action ) => { const reducer = map [ action . type ] ; if ( typeof reducer !== 'undefined' ) { return reducer ( state , action ) ; } if ( typeof state !== 'undefined' ) { return state ; } return defaultState ; } ; } export function isActionOfType < T extends ActionType > ( action , type ) { return type === action . type ; }