import { createPageModule } from 'redux-with-domain' ; import reportDomain from '../../domain/report' ; import ReportCanvasModule from '../../container/common/reportCanvas' ; export default createPageModule ( 'report' , { initialState : { reportId : '' } , reducers : { saveReportId : ( state , { payload } ) => { return { ... state , reportId : payload } ; } } , effects : ( { actions , sagaEffects : { call , put } , enhancer : { syncPut } } ) => ( { * init ( { payload : id } ) { yield syncPut ( actions . saveReportId ( id ) ) ; yield syncPut ( reportDomain . services . fetchReports ( [ id ] ) ) ; yield syncPut ( ReportCanvasModule . actions . reloadChart ( id ) ) ; } } ) } ) ;