[Persisted] Make broadcast subscriptions granular by key (#4874)
* Add fast path for guaranteed noop updates * Change persisted.onUpdate() API to take a key * Implement granular broadcast listeners
This commit is contained in:
parent
966f6c511f
commit
686d5ebb53
17 changed files with 95 additions and 42 deletions
|
@ -41,7 +41,10 @@ export async function write<K extends keyof Schema>(
|
|||
}
|
||||
write satisfies PersistedApi['write']
|
||||
|
||||
export function onUpdate(_cb: () => void): () => void {
|
||||
export function onUpdate<K extends keyof Schema>(
|
||||
_key: K,
|
||||
_cb: (v: Schema[K]) => void,
|
||||
): () => void {
|
||||
return () => {}
|
||||
}
|
||||
onUpdate satisfies PersistedApi['onUpdate']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue