import { createDomainModule } from 'redux-with-domain' ; import { quertyReportList } from '../api/report' ; export interface ReportItem { id : string ; name : string ; workbookId : string ; } interface Entities { reportList : ReportItem ; } interface Effects { fetchReports : ( data : { payload : string [ ] ; } ) => any ; } export default createDomainModule < Entities , { } , Effects > ( 'domain/report' , { entities : { reportList : 'id' } , selectors : { } , services : ( { services , entities , sagaEffects : { put , call } } ) => ( { * fetchReports ( { payload } ) { const reports = yield call ( quertyReportList , payload ) ; entities . reportList . insert ( reports ) ; } } ) } ) ;