UNPKG

@ngxs-labs/entity-state

Version:

<p align="center"> <img src="https://raw.githubusercontent.com/ngxs-labs/emitter/master/docs/assets/logo.png"> </p>

31 lines (30 loc) 1.37 kB
import { StateOperator } from '@ngxs/store'; import { Dictionary } from '../internal'; import { EntityStateModel } from '../models'; /** * Removes all entities, clears the active entity and updates the `lastUpdated` timestamp. */ export declare function removeAllEntities<T>(): StateOperator<EntityStateModel<T>>; /** * Removes the entities specified by the given IDs. * The active entity will be cleared if included in the given IDs. * Updates the `lastUpdated` timestamp. * @param ids IDs to remove */ export declare function removeEntities<T>(ids: string[]): StateOperator<EntityStateModel<T>>; /** * Only clears the `active` entity, if it's included in the given array. * All other fields will remain untouched in any case. * @param idsForRemoval the IDs to be removed */ export declare function clearActiveIfRemoved<T>(idsForRemoval: string[]): StateOperator<EntityStateModel<T>>; /** * Removes the given items from the existing items, based on equality. * @param forRemoval items to remove */ export declare function removeEntitiesFromArray<T>(forRemoval: T[]): StateOperator<Array<T>>; /** * Removes items from the dictionary, based on the given keys. * @param keysForRemoval the keys to be removed */ export declare function removeEntitiesFromDictionary<T>(keysForRemoval: string[]): StateOperator<Dictionary<T>>;