@weasel-js/prefs 1.9.4 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,13 @@ repair stored values that no longer fit the schema without writing them back.
19
19
  live in `@weasel-js/prefs/react`, so the main entry never loads React.
20
20
  `usePrefsValues` returns the pieces `@weasel-js/ui`'s `PrefsForm` takes.
21
21
 
22
+ `usePrefsStore(schema, { storage, prefix })` gives a component a store of its
23
+ own: open from its first render, closed with its writes sent when it unmounts.
24
+ It takes an adapter that reads synchronously, and components naming the same
25
+ `storage`, `prefix`, and `schema` share one store. Components naming one
26
+ `storage` and `prefix` with different schemas each get a store over the same
27
+ records.
28
+
22
29
  ## Ranges
23
30
 
24
31
  A number leaf's range is one scale: the low end is the least of what its label