noggin

Events

Every live noggin exposes two observable event streams:

Both accessors match the Event<T> primitive: pass a handler, get a Disposable whose dispose() unsubscribes. Modelled after vscode.Event.

Ordering guarantees

onDidChange fires after the mutation has been persisted and accessors reflect the new state. Verb methods return their result only after the corresponding event has fired. That means:

const events = [];
const sub = noggin.onDidChange((e) => events.push(e));
await noggin.push({ title: 'x' });
sub.dispose();
// events.length === 1; noggin.items already contains the new item.

For change events observed through an RPC-remoted RemoteNoggin, the server-adapter delivers the corresponding noggin.changed notification before returning the verb's response — see noggin-rpc for the wire-level ordering rules.