reapex-module-monitor
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

Reapex action monitoring module

import monitorModule from 'reapex-module-monitor'
const app = new App()

function doTrack(data: any[]) {
  console.log(data)
}

const monitor = app.use(monitorModule, {trackFunc: doTrack, interval: 5000})

monitor.track({
  [actionTypes.decrease]: function* (action: ReturnType<typeof mutations.decrease>, beforeState, afterState) {
    const total = CounterModel.selectors.total(afterState)
    const [num] = action.payload
    return {
      key: actionTypes.decrease,
      data: { total, num },
    }
  },
  [actionTypes.increase]: function* (action: ReturnType<typeof mutations.increase>, beforeState, afterState) {
    const total = yield select(CounterModel.selectors.total)
    const [num] = action.payload
    return {
      key: actionTypes.increase,
      data: { total, num },
    }
  }
})

Package Sidebar

Install

npm i reapex-module-monitor

Weekly Downloads

2

Version

1.2.1

License

MIT

Unpacked Size

24.5 kB

Total Files

22

Last publish

Collaborators

  • ruanyu1