Currently, the view value (Type.value(state)) is re-computed every time, and this has at least a O(n) complexity.
An application typically listens to state changed events and then calls .value(state), which is expensive to do every time there is a mutation.
Instead of computing the state every time .value() is called, this PR allows to keep the value around and, on each delta applied, change the value accordingly.
Currently, the view value (Type.value(state)) is re-computed every time, and this has at least a O(n) complexity. An application typically listens to state changed events and then calls .value(state), which is expensive to do every time there is a mutation.
Instead of computing the state every time .value() is called, this PR allows to keep the value around and, on each delta applied, change the value accordingly.
So far, only the RGA type supports this.