From 398b296552121db8e701180571e4721c26da9624 Mon Sep 17 00:00:00 2001 From: xinglu01 <15245457817@163.com> Date: Mon, 14 Oct 2024 16:34:29 +0800 Subject: [PATCH] fix(store): handle entities synchronization when remove --- packages/store/entity-store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/store/entity-store.ts b/packages/store/entity-store.ts index ca0ff71..abc233b 100644 --- a/packages/store/entity-store.ts +++ b/packages/store/entity-store.ts @@ -420,7 +420,7 @@ export class EntityStore, TEnti const originalLength = state.entities.length; state.entities = produce(state.entities, this.options).remove(idsOrFn as Id | Id[]); this.decreasePagination(originalLength - state.entities.length); - this.next(state); + this.next({ ...state }); } trackBy = (_index: number, entity: TEntity) => { @@ -439,7 +439,7 @@ export class EntityStore, TEnti state.entity = {} as TEntity; state.pagination = null; state.references = null; - this.next(state); + this.next({ ...state }); } protected getEntityById(id: Id): TEntity | null {