-
-
Notifications
You must be signed in to change notification settings - Fork 861
Closed
danactive/history
#415Description
Let's assume array = [ 0 ]
. Should array.pop()
result in { op: "remove", path: [ "0" ] }
instead of { op: "replace", path: [ "length" ], value: 0 }
?
I guess Immer is already "breaking" from the spec by making path
an array and not /foo/bar
, but you could argue replacing length
isn't friendly to non-JS environments.
I assume the current behavior improves performance slightly.
https://codesandbox.io/s/0o1zx5226l
- Version: 1.7.2
- Occurs when using Proxies (use
setUseProxies(true)
) - Occurs in the ES5 implementation (use
setUseProxies(false)
)
jsdevtom