State shared by this toolbar's row, widgets and windows on this page; create stores
at the top level of the script. Values last until the toolbar is hidden or the page reloads,
unless the store persists.
Signature
store<T>(initial: T | (() => T), options?: {
/** * Keeps the value across pages, tabs and restarts under this name, for this toolbar only: lowercase kebab-case, at * most 40 characters, such as 'settings'. The value is JSON data of at most 8 KiB; a toolbar keeps at most 16 such * stores and 32 KiB in all. A kept value replaces `initial`. Bundleware 0.4 and later. */
persist?: string;
}): Store<T>
Take it from
const { store } = Bundleware;
Parameters
Parameter
Type
Description
initial
T | (() => T)
options
{
/**
* Keeps the value across pages, tabs and restarts under this name, for this toolbar only: lowercase kebab-case, at
* most 40 characters, such as 'settings'. The value is JSON data of at most 8 KiB; a toolbar keeps at most 16 such
* stores and 32 KiB in all. A kept value replaces `initial`. Bundleware 0.4 and later.
*/
persist?: string;
}
Optional.
options.persist
string
Optional. Keeps the value across pages, tabs and restarts under this name, for this toolbar only: lowercase kebab-case, at
most 40 characters, such as 'settings'. The value is JSON data of at most 8 KiB; a toolbar keeps at most 16 such
stores and 32 KiB in all. A kept value replaces initial. Bundleware 0.4 and later.
Return Value
Member
Type
Description
get()
T
set(next)
void
Replaces the value, or computes it from the previous one, and re-renders every component using it. A store that
persists throws for a value that is not JSON data or goes over its limits, and keeps the value it had.