mobx 的 createTransformer 和 mobx-utils computedFn 有什么区别?
what is the difference between mobx's createTransformer and mobx-utils computedFn?
mobx 的 createTransformer 和 mobx-utils computedFn 有什么区别?
有时 mobx 和 mobx-utils 之间存在重叠(即 whenWithTimeout),但当我看到过去后者已被标记为弃用时。查看 computedFn 的实现,它似乎可以做一些额外的事情来观察传递给 computedFn() 结果的参数。不过我不确定。
https://mobx.js.org/refguide/create-transformer.html and https://github.com/mobxjs/mobx-utils#computedfn
来自https://github.com/mobxjs/mobx-utils/issues/199
createTransformer
doesn't need a 'host' to store it's state in. If you can leverage computedFn
, I would.
mobx 的 createTransformer 和 mobx-utils computedFn 有什么区别?
有时 mobx 和 mobx-utils 之间存在重叠(即 whenWithTimeout),但当我看到过去后者已被标记为弃用时。查看 computedFn 的实现,它似乎可以做一些额外的事情来观察传递给 computedFn() 结果的参数。不过我不确定。
https://mobx.js.org/refguide/create-transformer.html and https://github.com/mobxjs/mobx-utils#computedfn
来自https://github.com/mobxjs/mobx-utils/issues/199
createTransformer
doesn't need a 'host' to store it's state in. If you can leveragecomputedFn
, I would.