Class TJSDocumentCollection<C>
Type Parameters
- C extends DocumentCollection
Foundry Collection.
Index
Constructors
constructor
- new TJSDocumentCollection<C extends DocumentCollection>(
collection?: C | TJSDocumentCollection.Options.Config<C>,
options?: TJSDocumentCollection.Options.Config<C>,
): TJSDocumentCollection<C>Type Parameters
- C extends DocumentCollection
Parameters
Optionalcollection: C | TJSDocumentCollection.Options.Config<C>Collection to wrap or TJSDocumentCollectionOptions.
Optionaloptions: TJSDocumentCollection.Options.Config<C>TJSDocumentCollection options.
Returns TJSDocumentCollection<C>
Accessors
updateOptions
Returns the options passed on last update.
Returns TJSDocumentCollection.Data.Update
Last update options.
uuid
- get uuid(): string
Returns the UUIDv4 assigned to this store.
Returns string
UUIDv4
Methods
destroy
Completely removes all internal subscribers, any optional delete callback, and unregisters from the DocumentCollection
appstracking array.Returns void
get
Returns C
Current collection if any.
set
Sets a new document collection target to be monitored. To unset use
undefinedornull.Parameters
- collection: C
New collection to set.
Optionaloptions: Partial<TJSDocumentCollection.Data.Update>New collection update options to set.
Returns void
- collection: C
setOptions
Sets options for this collection wrapper / store.
Parameters
- options: TJSDocumentCollection.Options.Config<C>
Options for TJSDocumentCollection.
Returns void
- options: TJSDocumentCollection.Options.Config<C>
subscribe
Parameters
- handler: TJSDocumentCollection.SubscriberFn<C>
Callback function that is invoked on update / changes.
Returns Unsubscriber
Unsubscribe function.
- handler: TJSDocumentCollection.SubscriberFn<C>
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.