Please enable JavaScript.
Coggle requires JavaScript to display documents.
immer - Coggle Diagram
immer
具体api
-
applyPatches
给定一个基本状态或者draft,和一组修补程序,并应用这些修补程序
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
produceWithPatches
和produce一样,但是他不返回一个对象,而是返回一个元祖,包括了[result,patches,inversePatches].
-
-
大概使用
-
对于复杂对象操作的方式
-
变更数组
-
delete
array.splice(3, 1),第三位截取一位
-
insert
arry.splice(3, 0, { id: 3, name: 'li", value: 'ping'})
-
-
-
-