import ResourceHandlers from "common/ResourceHandlers" ; import { MessageResource , State } from "entity/message" ; import { ModuleNames } from "modules/names" ; import { Actions , effect , exportModel } from "react-coat" ; import api from "./api" ; export { State } from "entity/message" ; const initState = { } ; class ModuleHandlers extends ResourceHandlers < MessageResource , State > { constructor ( init ) { super ( init , { api } ) ; } @ effect ( ) protected async [ ModuleNames . messages + "/INIT" ] ( ) { await super . onInit ( ) ; } } export type ModuleActions = Actions < ModuleHandlers > ; export default exportModel ( ModuleNames . messages , ModuleHandlers , initState ) ;