Themes

Stores/Types/Plugin
Plugin
Plugin<T extends any> = (store: Store<T> ) => Subscription<T>

Store

A basic key value store.

Name
Description
Type
[$data]

internal access to data

Readonly<Map<keyofT, T>>
on

subscribe to events within the store

OnHandler<T>
onChange

Listen for value changes on a specified key.

OnChangeHandler<T>
size

the number of key / value pairs in the store

number
state

Proxied object that will detect dependencies and call the subscriptions and computed properties.

T
delete

remove value for key in store

(key: K ) => boolean
dispose

Resets the state to its original state and signals a dispose event to all the plugins.

() => void
get

Get value for key in store.

(key: K ) => T[K]
has

Check if store has key

(key: K ) => boolean
keys

remove value for key in store

() => IterableIterator<keyofT>
reset

Resets the state to its original state.

() => void
set

set value for key in store

(key: K value: T[K] ) => void
use

Registers a subscription that will be called whenever the user gets, sets, or resets a value.

(plugins: Plugin<T>[]) => () => void

Subscription

An interface for creating subscriptions on the store.

Name
Description
Type
delete

Triggered when an item is deleted from the store.

DeleteEventHandler<StoreType>
dispose

Triggered when the dispose method is called on the store.

DisposeEventHandler
get

Triggered when an item is read from the store.

GetEventHandler<StoreType>
insert

Triggered when an item not previously in the store was set.

InsertEventHandler<StoreType>
keys

Triggered when the keys of the store where read. For example, the store is iterated over.

KeysEventHandler
reset

Triggered when the store is reset.

ResetEventHandler
set

Triggered when an item is set in the store (regardless of if it was previously present or not).

SetEventHandler<StoreType>