IsomorphicFetchEvent
Overview
Usage
- Node
- Deno
- Browser/ESM
import { IsomorphicFetchEvent } from 'keywork/events/classes'
import { IsomorphicFetchEvent } from 'https://deno.land/x/keywork/events/classes'
let { IsomorphicFetchEvent } = await import('https://esm.sh/keywork/events/classes')
Type parameters
Name | Type |
---|---|
BoundAliases | {} |
ExpectedParams | {} |
Data | {} |
Hierarchy
↳
IsomorphicFetchEvent
Implements
EventInit
Constructors
constructor
new IsomorphicFetchEvent
new IsomorphicFetchEvent<BoundAliases, ExpectedParams, Data>(eventType?, __namedParameters)
Type parameters
Name | Type |
---|---|
BoundAliases | {} |
ExpectedParams | {} |
Data | {} |
Parameters
Name | Type | Default value |
---|---|---|
eventType | string | 'fetch' |
__namedParameters | IsomorphicFetchEventInit< BoundAliases, Data> | undefined |
Overrides
IsomorphicExtendableEvent.constructor
Defined in
events/classes/IsomorphicFetchEvent.ts:55
Properties
clientId
readonly clientId: `string`
Defined in
events/classes/IsomorphicFetchEvent.ts:32
data
data: `Data`
Defined in
events/classes/IsomorphicFetchEvent.ts:38
env
env: `BoundAliases`
Defined in
events/classes/IsomorphicFetchEvent.ts:37
handled
readonly handled: `Promise<undefined>`
Defined in
events/classes/IsomorphicFetchEvent.ts:34
match
match: `URLPatternResult`
The result of the URL pattern match from the RequestRouter
.
Defined in
events/classes/IsomorphicFetchEvent.ts:44
originalURL
originalURL: `string`
The original URL of the request.
Defined in
events/classes/IsomorphicFetchEvent.ts:54
params
params: `ExpectedParams`
Defined in
events/classes/IsomorphicFetchEvent.ts:39
preloadResponse
readonly preloadResponse: `Promise<any>`
Defined in
events/classes/IsomorphicFetchEvent.ts:35
request
request: `Request`
The incoming request received by the Worker.
Defined in
events/classes/IsomorphicFetchEvent.ts:49
resultingClientId
readonly resultingClientId: `string`
Defined in
events/classes/IsomorphicFetchEvent.ts:33
Methods
dispose
dispose
(): `void`
Returns
void
Inherited from
IsomorphicExtendableEvent.dispose
Defined in
events/classes/IsomorphicExtendableEvent.ts:60
flushTasks
flushTasks
(this): `Promise<void>`
Awaits all tasks remaining in the queue.
Parameters
Name | Type |
---|---|
this | IsomorphicExtendableEvent |
Returns
Promise<void>
Inherited from
IsomorphicExtendableEvent.flushTasks
Defined in
events/classes/IsomorphicExtendableEvent.ts:54
passThroughOnException
passThroughOnException
(): `void`
Prevents a runtime error response when the Worker script throws an unhandled exception.
Deprecated
The passThroughOnException
method is only applicable to Service Workers
See
Returns
void
Defined in
events/classes/IsomorphicFetchEvent.ts:89
respondWith
respondWith
(_response): `void`
Intercepts the request and allows the Worker to send a custom response.
Deprecated
The respondWith
method is only applicable to Service Workers.
See
Parameters
Name | Type |
---|---|
_response | Response |
Returns
void
Defined in
events/classes/IsomorphicFetchEvent.ts:75
waitUntil
waitUntil
(this, nonBlockingTask): `void`
Extends the lifetime of the route handler, even after a Response
is sent to a client.
Parameters
Name | Type | Description |
---|---|---|
this | IsomorphicExtendableEvent | - |
nonBlockingTask | Promise<any> |
Returns
void
Inherited from
IsomorphicExtendableEvent.waitUntil
Defined in
events/classes/IsomorphicExtendableEvent.ts:33
Represents an event dispatched when a network request is made.
Keywork uses
IsomorphicFetchEvent
as a context object for each incoming request made to aRequestRouter
. You can use this object to access the incoming request, the environment variables, and the data passed to the Worker.Generally,
IsomorphicFetchEvent
should not be instantiated directly, but rather is automatically created by theRequestRouter
when a request is received.