Finish pass on docs

This commit is contained in:
Jon Staab
2025-06-10 15:48:00 -07:00
parent 1a81768e8e
commit ee6fa8b956
19 changed files with 545 additions and 435 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ type Start<T> = (set: Subscriber<T>) => Unsubscriber
export type CustomStoreOpts<T> = {
throttle?: number
set?: (x: T) => void
onUpdate?: (x: T) => void
}
export const custom = <T>(
@@ -30,13 +30,13 @@ export const custom = <T>(
get: () => value,
set: (newValue: T) => {
set(newValue)
opts.set?.(newValue)
opts.onUpdate?.(newValue)
},
update: (f: (value: T) => T) => {
const newValue = f(value)
set(newValue)
opts.set?.(newValue)
opts.onUpdate?.(newValue)
},
subscribe: (sub: Subscriber<T>) => {
if (opts.throttle) {