You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// define initial state object that will be used as the default stateconstinitialState={someKey: 'someValue',}// if you are planning to use events, also declare event data typestypeMyEventTypes={'showAlert': string}
Exporting with createModel():
exportconstMyModel=createModel(Model<MyModelModelState,myModelModelEvents>)// with creating custom class (which can be extended)classMyModelClassextendsModel<MyModelModelState,myModelModelEvents>{constructor(){super(initialState)}}exportconstMyModel=createModel(MyModelClass)// or like this for convinienceexportconst{Ctx: MyModelCtx,Provider: MyModelProvider,withProvider: withMyModelProvider,withModel: withMyModel,useModel: useMyModel,useState: useMyModelState,useEvent: useMyModelEvent,}=createModel(MyModelClass)