ProtectedconstructorCreate an Adapter.
The blueprint to create the adapter.
Protected ReadonlyblueprintProtected ReadonlyhooksProtected ReadonlymiddlewareProtected ReadonlyresolvedProtectedbuildBuild the raw response.
The event context.
OptionaleventHandler: AdapterEventHandlerType<IncomingBrowserEvent, OutgoingBrowserResponse>
The event handler to be run.
The raw response wrapper.
ProtectedeventProcesses an incoming Browser event.
This method transforms the raw Browser event into a Stone.js IncomingBrowserEvent,
processes it through the pipeline, and generates a RawResponse to send back.
The raw Browser event to be processed.
The Browser execution context for the event.
A promise resolving to the processed RawResponse.
ProtectedexecuteExecute the event handler lifecycle hooks.
The hook to execute.
The event handler to be run.
ProtectedexecuteExecute adapter lifecycle hooks.
The hook's name.
Optionalcontext: BrowserAdapterContext
The event context.
Optionalerror: any
The error to handle.
ProtectedhandleHandle error.
The error to handle.
The event context.
The raw response.
ProtectedhandleHandle the event.
The event context.
The event handler to be run.
The raw response wrapper.
ProtectedmakeCreate pipeline options for the Adapter.
The pipeline options for transforming the event.
ProtectedonProtectedresolveGet the error handler for the given error.
The error to get the handler for.
The error handler.
ProtectedresolveExecutes the adapter and provides an Browser-compatible handler function.
The run method initializes the adapter and listens for incoming Browser events.
It processes these events, generates a response, and sends it back to the Browser.
Idempotent: calling run() again tears down the previous listeners first, so HMR
reloads and tests never accumulate duplicate handlers.
ProtectedsendSend the raw event through the destination.
The event context.
The event handler to be run.
Platform-specific response.
Tear down the adapter: remove all registered window listeners and run onStop hooks.
Safe to call multiple times and when the adapter was never started.
ProtectedvalidateValidate the context and event handler.
The context to validate.
The event handler to validate.
Staticcreate
Browser Adapter for Stone.js.
The
BrowserAdapterprovides seamless integration between Stone.js applications and the Browser environment. It processes incoming events from Browser, transforms them intoIncomingBrowserEventinstances, and returns aBrowserResponse.This adapter ensures compatibility with Browser's execution model and abstracts the event handling process for Stone.js developers.
Template: BrowserEvent
The type of the raw event received from Browser.
Template: BrowserResponse
The type of the response to send back to Browser.
Template: BrowserContext
The Browser execution context type.
Template: IncomingBrowserEvent
The type of the processed incoming event.
Template: IncomingBrowserEventOptions
Options used to create an incoming event.
Template: OutgoingBrowserResponse
The type of the outgoing response after processing.
Template: BrowserAdapterContext
Context type specific to the adapter.
Example
See
Stone.js Documentation