const state = { name : 'test' } ; const user = { state , reducers : { setName ( { payload , state } ) { return { ... state , ... payload } ; } } , effects : { async fetchNameAndSet ( { dispatch } ) { const name = await Promise . resolve ( 'fetch_name' ) ; dispatch . user . setName ( { name } ) ; } } } ; export default user ;