lit-ui-router / ContextRequestEvent
Class: ContextRequestEvent<T>
Defined in: packages/lit-ui-router/src/context.ts:128
A context-request event for any key: bubbling, composed and shaped as the protocol specifies, so any provider answers it.
Extends
Event
Extended by
Type Parameters
| Type Parameter | Description |
|---|---|
T extends UnknownContext | the context key's type, branded with the value it references |
Implements
Constructors
Constructor
ts
new ContextRequestEvent<T>(
context,
callback,
subscribe?
): ContextRequestEvent<T>;Defined in: packages/lit-ui-router/src/context.ts:144
Parameters
| Parameter | Type | Description |
|---|---|---|
context | T | the context key to request |
callback | ContextCallback<ContextType<T>> | receives the value from whichever provider answers |
subscribe? | boolean | ask the provider to call back as the value changes |
Returns
ContextRequestEvent<T>
Overrides
ts
Event.constructorProperties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
callback | readonly | ContextCallback<ContextType<T>> | Called by the provider with the value. | packages/lit-ui-router/src/context.ts:135 |
context | readonly | T | The key this request is for, matched by identity. | packages/lit-ui-router/src/context.ts:133 |
subscribe? | readonly | boolean | Whether later values are wanted. | packages/lit-ui-router/src/context.ts:137 |