//Empty slice
new Slice<Todo>(Todo.COMPLETE, todo=>!todo.complete);
//Initialized slice
let todos = [new Todo(false, "You complete me!"),
new Todo(true, "You completed me!")];
new Slice<Todo>(Todo.COMPLETE, todo=>!todo.complete, todos);
Protected
_queryThe current query state.
The configuration for the store.
The EStore instance containing the elements considered for slicing
Primary index for the stores elements.
The element entries that are keyed by an id generated on the server.
The slice label
Protected
notifyCreate notifications that broacast the entire set of entries.
Protected
notifyCreate notifications that broacast store or slice delta state changes.
Protected
notifyNotifies observers of the store query.
An Observable<E[]> reference to the entities in the store or Slice instance.
The slice predicate
The current guid key for the EStore instance.
this.config.guidKey;
The current id key for the EStore instance.
this.config.idKey;
A snapshot of the query state.
Sets the current query state and notifies observers.
Returns true if the entries contain the identified instance.
Either an instance of type E
or a guid
identifying the instance.
true if the instance identified by the guid exists, false otherwise.
<pre>
let contains:boolean = source.contains(guid);
</pre>
Returns true if the entries contain the identified instance.
Either an instance of type E
or a id
identifying the instance.
true if the instance identified by the id
exists, false otherwise.
<pre>
let contains:boolean = source.contains(guid);
</pre>
Returns the number of entries contained.
Optional
p: Predicate<E>The predicate to apply in order to filter the count
Returns a snapshot of the number of entries contained in the store.
Optional
p: Predicate<E>The predicate to apply in order to filter the count
Protected
notifyCall all the notifiers at once.
Observe store state changes.
Optional
sort: ((a, b) => number)Optional sorting function yielding a sorted observable.
let todos$ = source.observe();
//or with a sort by title function
let todos$ = source.observe((a, b)=>(a.title > b.title ? -1 : 1));
Snapshot of the entries that match the predicate.
The predicate used to query for the selection.
A snapshot array containing the entities that match the predicate.
let todos:Todo[]=store.select(todo=>todo.title.length>100);
Utility method that applies the predicate to an array of entities and return the ones that pass the test.
Used to create an initial set of values
that should be part of the Slice
.
The the array of entities that pass the predicate test.
Generated using TypeDoc
perform initial notification to all observers, such that operations like combineLatest{} will execute at least once.