SrvObservable
Defined in: packages/core/src/kernel/types.ts:1588
A SrvCapable that supports change notification.
Implement on top of SrvCapable to let reactive consumers (auto-mount watchers, UI) observe post/remove events.
Example
Section titled “Example”import { srvFS, isSrvObservable, isSrvCapable } from '@fishnet/core'const srv = srvFS()if (isSrvCapable(srv) && isSrvObservable(srv)) { const unsub = srv.subscribe(ev => console.log(ev.type, ev.name)) unsub()}Methods
Section titled “Methods”subscribe()
Section titled “subscribe()”subscribe(
cb): () =>void
Defined in: packages/core/src/kernel/types.ts:1597
Subscribe to post/remove events.
Parameters
Section titled “Parameters”(event) => void
Returns
Section titled “Returns”() => void
Invariant
Section titled “Invariant”Returns an unsubscribe function — call it exactly once; calling twice is a no-op, never a double-unsubscribe error
Invariant
Section titled “Invariant”Callbacks fire synchronously from within postServer / removeServer;
exceptions in a callback propagate to the poster’s call site