Function
once
(
def: Definition,
callback: (event: {
type: Definition["type"]
properties: z.infer<Definition["properties"]>
}) => "done" | undefined,
)
Source from the content-addressed store, hash-verified
| 72 | } |
| 73 | |
| 74 | export function once<Definition extends BusEvent.Definition>( |
| 75 | def: Definition, |
| 76 | callback: (event: { |
| 77 | type: Definition["type"] |
| 78 | properties: z.infer<Definition["properties"]> |
| 79 | }) => "done" | undefined, |
| 80 | ) { |
| 81 | const unsub = subscribe(def, (event) => { |
| 82 | if (callback(event)) unsub() |
| 83 | }) |
| 84 | } |
| 85 | |
| 86 | export function subscribeAll(callback: (event: any) => void) { |
| 87 | return raw("*", callback) |
Callers
nothing calls this directly
Tested by
no test coverage detected