🐛 Bug Report
The curried form of produceWithPatches returns the wrong type, while produce does.
Link to repro
https://codesandbox.io/s/producewithpatches-wrong-return-type-mr5hdp?file=/src/index.ts
Observed behavior
The state returned by produceWithPatches((draft: Draft<N>, m: number) => { ... }) is of type WritableDraft<N> but should be of type N.
The type of produceWithPatches<N, [number]>((draft, m) => { ... }) is never while the type of produce<N, [number]>((draft, m) => { ... }) is as expected.
Expected behavior
The types of the values returned by produceWithPatches should be the same as produce.
Environment
🐛 Bug Report
The curried form of
produceWithPatchesreturns the wrong type, whileproducedoes.Link to repro
https://codesandbox.io/s/producewithpatches-wrong-return-type-mr5hdp?file=/src/index.ts
Observed behavior
The state returned by
produceWithPatches((draft: Draft<N>, m: number) => { ... })is of typeWritableDraft<N>but should be of typeN.The type of
produceWithPatches<N, [number]>((draft, m) => { ... })isneverwhile the type ofproduce<N, [number]>((draft, m) => { ... })is as expected.Expected behavior
The types of the values returned by
produceWithPatchesshould be the same asproduce.Environment
setUseProxies(true)setUseProxies(false)(ES5 only)