UNPKG

@datorama/akita

Version:

State Management Tailored-Made for JS Applications

17 lines (16 loc) 569 B
import { ArrayProperties, IDS, ItemPredicate } from './types'; /** * Remove item from collection * * @example * * * store.update(state => ({ * names: arrayRemove(state.names, ['one', 'second']) * })) */ export declare function arrayRemove<Root extends any[], Entity = Root[0]>(keyOrRoot: Root, identifier: IDS | ItemPredicate<Root[0]>, idKey?: string): Root[0][]; /** * @deprecated */ export declare function arrayRemove<Root, Entity = any>(keyOrRoot: ArrayProperties<Root>, identifier: IDS | ItemPredicate<Entity>, idKey?: string): (state: Root) => Root;