import { Action , Reducer } from 'redux' ; import { SubReducer } from './types' ; param initialState param reducer export default function withInitialState < S , A extends Action > ( initialState , reducer ? ) { return reducer ? ( state = initialState , action ) => reducer ( state , action ) : ( state = initialState ) => state ; }