You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(pos): add keys property to Storage type for subscribable access
Adds Subscribable, StorageKeys types and optional keys property to the
POS Storage interface. Each key is exposed as Subscribable<T | undefined>
for reactive updates across targets of the same extension.
Part of: shop/issues-retail#26020
* Stores a value under the specified key, overwriting any existing value. Values must be JSON-serializable and return `StorageError` when storage limits are exceeded. Commonly used for storing user preferences, caching API responses, or passing contextual data from tiles to modals.
18
37
*
@@ -73,3 +92,31 @@ export interface Storage<
73
92
KeysextendskeyofStorageTypes=keyofStorageTypes,
74
93
>(): Promise<[Keys,StorageTypes[Keys]][]>;
75
94
}
95
+
96
+
/**
97
+
* Represents a readonly value managed by the host that an extension can
98
+
* subscribe to for reactive updates.
99
+
*/
100
+
exportinterfaceSubscribable<Value=unknown>{
101
+
/** Synchronous access to the current value. */
102
+
readonlyvalue: Value;
103
+
/** Registers a callback that fires when the value changes. Returns an unsubscribe function. */
0 commit comments