UNPKG

mst-effect

Version:

Designed to be used with MobX-State-Tree to create asynchronous actions using RxJS.

14 lines (11 loc) 346 B
import { types as mstTypes } from 'mobx-state-tree' import { EFFECT_ACTIONS_HANDLER } from '../const' import { runActions } from '../effect/action' export const types: typeof mstTypes = { ...mstTypes, model(...params: any[]) { return mstTypes.model(...params).actions(() => ({ [EFFECT_ACTIONS_HANDLER]: runActions, })) }, }