import { Reducer } from 'redux' ; import { GET_LIST } from '../../../../../core' ; type State = Date ; const initialState = null ; const validityReducer = ( previousState = initialState , { payload , meta } ) => { switch ( meta . fetchResponse ) { case GET_LIST : { if ( payload . validUntil ) { return payload . validUntil ; } else { return initialState ; } } default : return previousState ; } } ; export default validityReducer ;