Skip to content

Documentation / @etherfold/browser / HostQueryHandler

Type Alias: HostQueryHandler ​

HostQueryHandler = (request, context) => Promise<unknown>

Defined in: packages/browser/src/host/query.ts:64

THE HANDLER an app's worker entry injects: an opaque request in, a structured-clone-safe answer out.

context resolves the store and generation for THIS operation; a handler calls it once per request. It may reject (no store yet on a host that stopped, a reader that cannot name its generation), and a handler that promises never to reject (as graphqlQueryHandler does) turns that into an answer of its own. A rejection that does escape is refused to the tab as any case's refusal is.

Parameters ​

request ​

unknown

context ​

() => Promise<HostQueryContext>

Returns ​

Promise<unknown>