Skip to content

Commit

Permalink
fix(store): handle entities synchronization when remove
Browse files Browse the repository at this point in the history
  • Loading branch information
xinglu01 authored and why520crazy committed Oct 14, 2024
1 parent 30986dd commit cac359b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/store/entity-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export class EntityStore<TState extends EntityState<TEntity, TReferences>, 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) => {
Expand All @@ -439,7 +439,7 @@ export class EntityStore<TState extends EntityState<TEntity, TReferences>, TEnti
state.entity = {} as TEntity;
state.pagination = null;
state.references = null;
this.next(state);
this.next({ ...state });
}

protected getEntityById(id: Id): TEntity | null {
Expand Down

0 comments on commit cac359b

Please sign in to comment.