You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes typed arrays is just the best way to store data. One of the aspects is that if you use web workers, it is much more efficient to pass TypedArrays (Array Buffer) instead of copying things around. Also, from my understanding, those are just the most efficient data structure.
I guess I'm mostly curious whether that's actually possible and how much effort that would take.
Can this be solved in user-land code?
Nope.
Example
import produce from "immer"
const baseState = [
{
data: new Uint16(9000),
data3D:[new Uint16(6756), new Uint16(789)]
}
]
const nextState = produce(baseState, draftState => {
draftState[0].data[93] = 0;
})
// or apply a patch
The text was updated successfully, but these errors were encountered:
Feel free to create a plugin that supports these data types, similar to how Map / Set is supported. Or it might be sufficient to widen the array detection in Immer to support those collections without any further changes
馃殌 Feature Proposal
Support typed arrays in Immer.
Motivation
Sometimes typed arrays is just the best way to store data. One of the aspects is that if you use web workers, it is much more efficient to pass TypedArrays (Array Buffer) instead of copying things around. Also, from my understanding, those are just the most efficient data structure.
I guess I'm mostly curious whether that's actually possible and how much effort that would take.
Can this be solved in user-land code?
Nope.
Example
The text was updated successfully, but these errors were encountered: