UNPKG

mst-effect

Version:

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

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