Hacker News new | ask | show | jobs
by spion 3213 days ago
MobX is the most powerful front end development library on the market right now. It single-handedly solves the cache invalidation problem in a performant way, and its pluggable into any framework.

And yes, promises limit it.

1 comments

How does one measure power? What market?
By actually using the thing being criticised instead of giving it the middlebrow dismissal.

The "market" of application state management libraries.

Frankly, S.js looks better. Simple and performant.
Slightly confusing api, no structural comparison, no adapters for popular frameworks (e.g. S.js-react or S.js-preact), no laziness (computations are recomputed even if they're not requested by reactions).
Why use react when you can use Surplus which is based on S.js? Surplus is the fastest among all of the JS frameworks and supports JSX.

"Slightly confusing" == I'm not familiar with it. Not really an objection.

"No structural comparison": don't know what this is supposed to mean.

Re: laziness, actually redundant recomputations are not performed. Not sure where you go that impression.

I don't want to use surplus because e.g. I want to use well developed UI components or toolkits like blueprintjs, which is implemented on top of React.

Slightly confusing is a real objection. MobX strives to implement transparent reactive programming, where the way you access, update and transform values works exactly like it would with regular objects. S.js has a worse learning curve.

Redundant computations are computed; see: https://codepen.io/anon/pen/vdWomE?editors=0010

even though the completed() computed isn't used anywhere, the reduction is still being recomputed every time todo state changes

No structural comparison:

MobX will stop dependant recomputation if the new value of an intermediate recomputation is equal to the previous value.

You also have the option of using structural equality instead of reference equality (and also you can use any custom equality comparison function)

https://mobx.js.org/refguide/computed-decorator.html#options...