From 09ac097513714130e08ff18bc7496c4fd04f6531 Mon Sep 17 00:00:00 2001 From: Josh Kelley Date: Thu, 24 Jun 2021 04:39:06 -0400 Subject: [PATCH] fix: Better applyPatches type (#810) applyPatches should specify its input as type `T` so that TypeScript can better infer the correct `T` for its output. Fixes #809 --- src/core/immerClass.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/immerClass.ts b/src/core/immerClass.ts index a2954a16..6975225c 100644 --- a/src/core/immerClass.ts +++ b/src/core/immerClass.ts @@ -185,7 +185,7 @@ export class Immer implements ProducersFns { this.useProxies_ = value } - applyPatches(base: Objectish, patches: Patch[]): T { + applyPatches(base: T, patches: Patch[]): T { // If a patch replaces the entire state, take that replacement as base // before applying patches let i: number