Skip to content

Commit

Permalink
chore: remove unused arg3 in produceWithPatches (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHung authored Oct 22, 2022
1 parent 352ae73 commit 078e523
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/immerClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ export class Immer implements ProducersFns {
}

produceWithPatches: IProduceWithPatches = (
arg1: any,
arg2?: any,
arg3?: any
base: any,
recipe?: any,
): any => {
if (typeof arg1 === "function") {
// curried invocation
if (typeof base === "function") {
return (state: any, ...args: any[]) =>
this.produceWithPatches(state, (draft: any) => arg1(draft, ...args))
this.produceWithPatches(state, (draft: any) => base(draft, ...args))
}

let patches: Patch[], inversePatches: Patch[]
const result = this.produce(arg1, arg2, (p: Patch[], ip: Patch[]) => {
const result = this.produce(base, recipe, (p: Patch[], ip: Patch[]) => {
patches = p
inversePatches = ip
})
Expand Down

0 comments on commit 078e523

Please sign in to comment.