merge two sets of patches created by immer produce.
newPatches take precedent over oldPatches for patches modifying the same path.
In the case many consecutive pathces are merged the original model should
always be the root model.
Example:
A -> B, patches1
B -> C, patches2
mergePatches(A, patches1, patches2) to get patches for A -> C
merge two sets of patches created by immer produce. newPatches take precedent over oldPatches for patches modifying the same path. In the case many consecutive pathces are merged the original model should always be the root model.
Example: A -> B, patches1 B -> C, patches2
mergePatches(A, patches1, patches2) to get patches for A -> C