【发布时间】:2019-11-13 16:05:58
【问题描述】:
如docs 中的autorun 可用于对被调用函数进行去抖动处理,因此最后一次调用是我们在一定时间内被调用的唯一一次。
但我不知道如何将它与使用flow 的action 一起使用,有什么例子吗?
例如:
syncMobileToken: flow(function* syncMobileToken(token) {
self.isLoading = true
let response = yield cli.post("/notifications/sync_mobile_token", {
token: token,
device_id: Config.DEVICE_ID,
})
self.isLoading = false
}),
autorun 将如何与上述示例一起使用?
【问题讨论】:
标签: mobx-state-tree