partial toolbar: basic writable store approach

This commit is contained in:
Elijah Duffy
2025-07-09 12:41:28 -07:00
parent e953c362cf
commit 414b63e8bc
5 changed files with 177 additions and 113 deletions

View File

@@ -1,3 +1,10 @@
/**
* MaybeGetter is a type that can either be a value of type T or a function that returns a value of type T.
* This is useful for cases where you might want to pass a value directly or a function that computes the
* value later, potentially taking advantage of reactivity.
*/
export type MaybeGetter<T> = T | (() => T);
/**
* Generates a unique identifier string unless an identifier is provided.
* If a prefix is provided, it will be prepended to the identifier.