Class FVTTObjectEntryStore<T>Abstract
Type Parameters
- T extends BaseArrayObject = BaseArrayObject
Hierarchy
- ObjectEntryStore<T>
- FVTTObjectEntryStore (View Summary)
Index
Constructors
Accessors
Methods
Constructors
Protectedconstructor
- new FVTTObjectEntryStore<T extends BaseArrayObject = BaseArrayObject>(
data: T,
gameSettingArrayObject?: GameSettingArrayObject<any>,
): FVTTObjectEntryStore<T>Type Parameters
- T extends BaseArrayObject = BaseArrayObject
Parameters
- data: T
Initial entry data.
OptionalgameSettingArrayObject: GameSettingArrayObject<any>Associated backing array object store. Automatically passed on entry creation by #runtime/svelte/store/reducer/array-object!ArrayObjectStore.
Returns FVTTObjectEntryStore<T>
Accessors
Protected_data
Returns T
The object data tracked by this store.
canEdit
- get canEdit(): boolean
Can the current user edit / save this instance to the Foundry DB.
Returns boolean
id
- get id(): string
Returns string
The ID attribute in object data tracked by this store.
Methods
Protected_updateSubscribers
Update subscribers of this store. Useful for child implementations.
Returns void
Abstractset
To be implemented by child implementations as required by the MinimalWritable contract. You must manually invoke ObjectEntryStore._updateSubscribers to notify subscribers.
Parameters
- data: T
Data to set to store.
Returns void
- data: T
subscribe
Parameters
- handler: Subscriber<T>
Callback function that is invoked on update / changes.
Returns Unsubscriber
Unsubscribe function.
- handler: Subscriber<T>
toJSON
Returns T
A JSON data object for the backing data. The default implementation directly returns the backing private data object. You may override this method to clone the data via ObjectEntryStore._data.
Staticduplicate
Invoked by ArrayObjectStore to provide custom duplication. Override this static method in your entry store.
Type Parameters
- S extends ArrayObjectStore<any>
Parameters
- data: object
A copy of local data w/ new ID already set.
- arrayStore: S
The source ArrayObjectStore instance.
Returns void
Provides an extension to #runtime/svelte/store/reducer/array-object!ObjectEntryStore adding the FVTTObjectEntryStore.canEdit accessor which when paired with GameSettingArrayObject forwards on whether the current Foundry user can edit / save to the Foundry DB.
This is the base ObjectEntryStore available from a direct import or through GameSettingArrayObject.EntryStore accessor.