@ngxs-labs/entity-state
Version:
<p align="center"> <img src="https://raw.githubusercontent.com/ngxs-labs/emitter/master/docs/assets/logo.png"> </p>
17 lines (16 loc) • 773 B
TypeScript
import { Payload } from './type-alias';
import { EntityState } from '../entity-state';
import { Type } from '@angular/core';
export declare type EntityAddAction<T> = Payload<T | T[]>;
export declare class Add<T> {
/**
* Generates an action that will add the given entities to the state.
* The entities given by the payload will be added.
* For certain ID strategies this might fail, if it provides an existing ID.
* In all other cases it will overwrite the ID value in the entity with the calculated ID.
* @param target The targeted state class
* @param payload An entity or an array of entities to be added
* @see CreateOrReplace#constructor
*/
constructor(target: Type<EntityState<T>>, payload: T | T[]);
}