From 078e5238e2a5069ec5c2859f55c5d500d4482de2 Mon Sep 17 00:00:00 2001 From: Brian Hung Date: Sat, 22 Oct 2022 05:40:20 -0700 Subject: [PATCH] chore: remove unused arg3 in produceWithPatches (#975) --- src/core/immerClass.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/immerClass.ts b/src/core/immerClass.ts index 2a6da927..9b379161 100644 --- a/src/core/immerClass.ts +++ b/src/core/immerClass.ts @@ -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 })