Class TJSDocumentCollection<T>
Type Parameters
Index
Constructors
constructor
- new TJSDocument
Collection <T>(collection?, options?): TJSDocumentCollection<T> Type Parameters
Parameters
Optional
collection: T | TJSDocumentCollectionOptionsCollection to wrap or TJSDocumentCollectionOptions.
Optional
options: TJSDocumentCollectionOptionsTJSDocumentCollection options.
Returns TJSDocumentCollection<T>
Accessors
updateOptions
- get updateOptions(): TJSDocumentCollectionUpdateOptions<T>
Returns the options passed on last update.
Returns TJSDocumentCollectionUpdateOptions<T>
Last update options.
uuid
- get uuid(): string
Returns the UUID assigned to this store.
Returns string
UUID
Methods
destroy
get
set
- set(collection, options?): void
Parameters
- collection: T
New collection to set.
Optional
options: TJSDocumentCollectionUpdateOptions<T>New collection update options to set.
Returns void
- collection: T
setOptions
- set
Options (options): void Sets options for this collection wrapper / store.
Parameters
- options: TJSDocumentCollectionOptions
Options for TJSDocumentCollection.
Returns void
- options: TJSDocumentCollectionOptions
subscribe
- subscribe(handler): Unsubscriber
Parameters
- handler: ((value: T, updateOptions?: TJSDocumentCollectionUpdateOptions<T>) => void)
Callback function that is invoked on update / changes.
- (value, updateOptions?): void
Parameters
- value: T
Optional
updateOptions: TJSDocumentCollectionUpdateOptions<T>
Returns void
Returns Unsubscriber
Unsubscribe function.
- handler: ((value: T, updateOptions?: TJSDocumentCollectionUpdateOptions<T>) => void)
Provides a wrapper implementing the Svelte store / subscriber protocol around any DocumentCollection. This makes document collections reactive in a Svelte component, but otherwise provides subscriber functionality external to Svelte.