Class TJSDocumentCollection<T>
Type Parameters
Index
Constructors
constructor
- new TJSDocumentCollection<T = object>(
collection?: T | TJSDocumentCollectionOptions,
options?: TJSDocumentCollectionOptions,
): 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: T, options?: TJSDocumentCollectionUpdateOptions<T>): void
Parameters
- collection: T
New collection to set.
Optional
options: TJSDocumentCollectionUpdateOptions<T>New collection update options to set.
Returns void
- collection: T
setOptions
- setOptions(options: TJSDocumentCollectionOptions): void
Sets options for this collection wrapper / store.
Parameters
- options: TJSDocumentCollectionOptions
Options for TJSDocumentCollection.
Returns void
- options: TJSDocumentCollectionOptions
subscribe
- subscribe(
handler: (
value: T,
updateOptions?: TJSDocumentCollectionUpdateOptions<T>,
) => void,
): Unsubscriber Parameters
- handler: (value: T, updateOptions?: TJSDocumentCollectionUpdateOptions<T>) => void
Callback function that is invoked on update / changes.
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.