@ngxs-labs/entity-state
Version:
<p align="center"> <img src="https://raw.githubusercontent.com/ngxs-labs/emitter/master/docs/assets/logo.png"> </p>
16 lines (15 loc) • 712 B
TypeScript
import { Type } from '@angular/core';
import { EntityState } from '../entity-state';
import { Payload } from './type-alias';
export declare type EntityCreateOrReplaceAction<T> = Payload<T | T[]>;
export declare class CreateOrReplace<T> {
/**
* Generates an action that will add the given entities to the state.
* If an entity with the ID already exists, it will be overridden.
* In all 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 Add#constructor
*/
constructor(target: Type<EntityState<T>>, payload: T | T[]);
}