directory$

View as MarkdownOpen in Claude
1get directory$(): Observable<Directory | undefined>

Observable that emits the Directory instance once the client is connected, or undefined while disconnected. Subscribe to this to safely wait for the directory to become available without risking an error.

Examples

1client.directory$.subscribe(dir => {
2 if (dir) dir.addresses$.subscribe(console.log);
3});

directory

1get directory(): Directory | undefined

Current directory snapshot, or undefined if the client is not yet connected. Prefer directory$ when you need to react to the directory becoming available.