Get all values from cache.
everything we got!
Get the entire cache as a map.
Retrieve an object from the cache
the string ID of the object you wish to get.
the object you're looking for.
Flip an internal bit to set the cache to ready, notify all watchers.
Return true if this is a galactic store.
Send a mutation command to any subscribers handling mutations.
to be mutated
the type of the mutation
provide object S to mutator function on successful mutation.
provide object E to mutator function on error.
true if mutation command was placed in stream
Subscribe to state changes for all objects of a specific type and state change
the state change type you with to listen to
stream that will tick the object you're online for.
Subscribe to state changes for a specific object.
the ID of the object you wish to receive updates.
the state change type you wish to listen to
stream that will tick the object you're online for.
Subscribe to mutation requests via mutate()
the object you want to listen for.
optional mutation type
stream that will tick mutation requests you're online for.
Populate the cache with a collection of objects and their ID's.
a Map of your UUID's mapped to your Objects.
if the cache has already been populated (has objects), will return false. This method has no effect for galactic stores.
Place an object into the cache, will broadcast to all subscribers online for state changes.
string ID of your object, UUID is highly recommended.
the object you wish to cache
the state change event you want to broadcast with this action (created, updated etc).
Restart auto-reload timer.
This method has no effect for galactic stores.
Reload store with refresh service call.
This method has no effect for galactic stores.
Remove/delete an object into the cache.
The string ID of the object you wish to remove.
you want to be sent to subscribers notifying cache deletion.
true if it was removed, false if not.
Will wipe all data out, in case you need a clean slate.
Set lambda that is used to auto-reload this store.
function should encapsulate a service call.
This method has no effect for galactic stores.
Start automatic reload. The store will refetch its data (using setAutoReloadServiceTrigger). The store is considered stale once the TTL has passed.
how long to hold data in the store before refetching. (default is 10 seconds)
This method has no effect for galactic stores.
Stop Store from auto-refreshing.
This method has no effect for galactic stores.
Notify when the cache has been initialize (via populate() or initialize()
that accepts the entire cache as a map.
Generated using TypeDoc
BusStore is a stateful in memory cache for objects. All state changes (any time the cache is modified) will broadcast that updated object to any subscribers of the BusStore online for those specific objects or all objects of a certain type and state changes.