-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathentity-collection-service.ts
45 lines (38 loc) · 1.69 KB
/
entity-collection-service.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { EntityAction, EntityActionOptions } from '../actions/entity-action';
import { EntityCommands } from '../dispatchers/entity-commands';
import { EntityDispatcher } from '../dispatchers/entity-dispatcher';
import { EntityOp } from '../actions/entity-op';
import { EntitySelectors$ } from '../selectors/entity-selectors$';
import { EntitySelectors } from '../selectors/entity-selectors';
// tslint:disable:member-ordering
/**
* A facade for managing
* a cached collection of T entities in the ngrx store.
*/
export interface EntityCollectionService<T> extends EntityCommands<T>, EntitySelectors$<T> {
/**
* Create an {EntityAction} for this entity type.
* @param op {EntityOp} the entity operation
* @param [data] the action data
* @param [options] additional options
* @returns the EntityAction
*/
createEntityAction(op: EntityOp, payload?: any, options?: EntityActionOptions): EntityAction<T>;
/**
* Create an {EntityAction} for this entity type and
* dispatch it immediately to the store.
* @param op {EntityOp} the entity operation
* @param [data] the action data
* @param [options] additional options
* @returns the dispatched EntityAction
*/
createAndDispatch<P = any>(op: EntityOp, data?: P, options?: EntityActionOptions): EntityAction<P>;
/** Dispatcher of EntityCommands (EntityActions) */
readonly dispatcher: EntityDispatcher<T>;
/** Name of the entity type for this collection service */
readonly entityName: string;
/** All selector functions of the entity collection */
readonly selectors: EntitySelectors<T>;
/** All selectors$ (observables of the selectors of entity collection properties) */
readonly selectors$: EntitySelectors$<T>;
}