Skip to content

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.

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()
}

subscribe(cb): () => void

Defined in: packages/core/src/kernel/types.ts:1597

Subscribe to post/remove events.

(event) => void

() => void

Returns an unsubscribe function — call it exactly once; calling twice is a no-op, never a double-unsubscribe error

Callbacks fire synchronously from within postServer / removeServer; exceptions in a callback propagate to the poster’s call site