Update docs

This commit is contained in:
Jon Staab
2026-06-10 14:12:47 -07:00
parent a33af11b1b
commit dbd043f105
35 changed files with 164 additions and 179 deletions
+5 -3
View File
@@ -16,7 +16,9 @@ Requests events from a single relay using the given filters. Returns a promise t
- `context?` - Adapter context
- `autoClose?` - Auto-close subscription after EOSE
- Validation functions: `isEventValid`, `isEventDeleted`
- Callback functions: `onEvent`, `onDeleted`, `onInvalid`, `onFiltered`, `onDuplicate`, `onDisconnect`, `onEose`, `onClose`
- Callback functions: `onEvent`, `onDeleted`, `onInvalid`, `onFiltered`, `onDuplicate`, `onDisconnect`, `onEose`, `onClosed`, `onClose`
- `onClosed?: (message: string, url: string) => void` - Called when the relay sends a CLOSED message, receiving the close reason and relay URL
- `onClose?: () => void` - Called when the subscription is fully closed
### request(options)
@@ -38,9 +40,9 @@ Creates a batched loader function that delays and combines requests for efficien
- `threshold?` - Relay completion threshold
- Validation functions and context options
### load(filters, relays, options)
### load(options)
Pre-configured loader with 200ms delay, 3s timeout, and 0.5 threshold.
Pre-configured loader with 200ms delay, 3s timeout, and 0.5 threshold. Takes a `LoadOptions` object containing `relays`, `filters`, and optional callback fields (`onEvent`, `onDisconnect`, `onEose`, `onClose`) and an optional `signal`.
## Example