import { Effect } from 'umi' ; import { createData } from './service' ; export interface StateType { } export interface ModelType { namespace : string ; state : StateType ; effects : { create : Effect ; } ; reducers : { } ; } const initState = { } ; const Model = { namespace : 'FormComplex' , state : initState , effects : { * create ( { payload } , { call , put } ) { try { yield call ( createData , payload ) ; return true ; } catch ( error ) { return false ; } } , } , reducers : { } , } ; export default Model ;