refnew0.0.9 • Public • Published
proxy based state management utility.
Typically React apps needs to implement
shouldComponentUpdate for performance.
But it tends to be ugly implementation because object references are same always.
immer are try solve this problem by immutability.
I tried implementing
refnew to solve this problem by other way.
refnew provide way to manage object references.
If you modify object's value, you can check object equality by
See refnew's test.
npm install refnew
- runtime environment required
- refnew is hobby project now, you don't use this in production yet.
- refnew is fast to mutate but property access is slow.
- it's means
refnew is maybe slow in real world apps.
- if you use chrome62 or higher, refnew is meybe better performance.
- it's means
- inspired by
;;// create your state.const state =;// pick part of state.const todos = statetodos;// off course, object are equal.assert;// modify part of state.todos;// can check object equality by `===`.assert;
npm run perf //=> node v10.9.0
# 500000/kind## nested property mutate: refnew1059## nested property access: refnew128## nested property mutate: immer2490## nested property access: immer4
- support more built-in classes.
- support edge case and messages.
- test on real world apps.