Class ArrayObjectStore<S>
Type Parameters
- S extends BaseObjectEntryStore<any>
Hierarchy
- ArrayObjectStore (View Summary)
Constructors
constructor
-
new ArrayObjectStore<S extends BaseObjectEntryStore<any>>(
options: ArrayObjectStore.Options.Config<S>,
): ArrayObjectStore<S>Type Parameters
- S extends BaseObjectEntryStore<any>
Store type.
Parameters
- options: ArrayObjectStore.Options.Config<S>
ArrayObjectStore options.
Returns ArrayObjectStore<S>
- S extends BaseObjectEntryStore<any>
Accessors
Protected_data
-
Returns S[]
The internal data array tracked allowing child classes direct access.
dataReducer
-
Returns DynArrayReducer<S>
The data reducer.
length
-
get length(): number
Returns number
The length of all data.
StaticEntryStore
-
Returns typeof ObjectEntryStore
The default object entry store constructor that can facilitate the creation of the required ArrayObjectStore.Options.Config.StoreClass and generic
Ttype parameter.
Methods
[iterator]
clearEntries
-
Removes all child store entries.
Returns void
createEntry
-
Creates a new store from given data.
Parameters
- entryData: ExtractDataType<S>
Entry data.
Returns S
The store
- entryData: ExtractDataType<S>
deleteEntry
-
Deletes a given entry store by ID from this world setting array store instance.
Parameters
- id: string
ID of entry to delete.
Returns boolean
Delete operation successful.
- id: string
duplicateEntry
-
Duplicates an entry store by the given ID.
Parameters
- id: string
UUIDv4 string.
Returns S
Instance of StoreClass.
- id: string
findEntry
getEntry
-
Finds an entry store instance by 'id' / UUIDv4.
Parameters
- id: string
A UUIDv4 string.
Returns S
Entry store instance.
- id: string
set
-
Sets the children store data by 'id', adds new entry store instances, or removes entries that are no longer in the update list.
Parameters
- updateList: ExtractDataType<S>[]
Returns void
subscribe
-
Parameters
- handler: Subscriber<S[]>
Callback function that is invoked on update / changes.
Returns Unsubscriber
Unsubscribe function.
- handler: Subscriber<S[]>
toJSON
-
Returns S[]
Store type.