what is the difference between mobx's createTransformer and mobx-utils computedFn?

1.6k Views Asked by At

What is the difference between mobx's createTransformer and mobx-utils computedFn?

Sometimes there is overlap between things in mobx and mobx-utils (ie whenWithTimeout) but when I've seen that in the past the later has been marked deprecated. Looking into the implementation of computedFn, it seems like it could be doing something additional to observe the arguments passed into the computedFn() result. I'm not sure though.

https://mobx.js.org/refguide/create-transformer.html and https://github.com/mobxjs/mobx-utils#computedfn

1

There are 1 best solutions below

0
flipchart On BEST ANSWER

From 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.