Skip to content

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 ParameterDescription
T extends UnknownContextthe 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 ​

ParameterTypeDescription
contextTthe context key to request
callbackContextCallback<ContextType<T>>receives the value from whichever provider answers
subscribe?booleanask the provider to call back as the value changes

Returns ​

ContextRequestEvent<T>

Overrides ​

ts
Event.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
callbackreadonlyContextCallback<ContextType<T>>Called by the provider with the value.packages/lit-ui-router/src/context.ts:135
contextreadonlyTThe key this request is for, matched by identity.packages/lit-ui-router/src/context.ts:133
subscribe?readonlybooleanWhether later values are wanted.packages/lit-ui-router/src/context.ts:137