import { ActionType , getType } from 'typesafe-actions' ; import { LyraGlobalsRecord , LyraGlobals } from '../store/factory/Lyra' ; import * as lyraActions from '../actions/lyraActions' ; param { boolean } state param { Object } action returns { boolean } export function lyraGlobalsReducer ( state , action ) { if ( typeof state === 'undefined' ) { return LyraGlobals ( { idCounter : 1 } ) ; } if ( action . type === getType ( lyraActions . incrementCounter ) ) { return state . set ( 'idCounter' , state . get ( 'idCounter' ) + 1 ) ; } return state ; }