Context

View Source

Summary

Context storage API exposed on component handles.

Signature

interface Context<C> {
  get<ComponentType>(component: ComponentType): ContextFrom<ComponentType>;
  get(component: symbol | ElementType): unknown;
  set(values: C): void;
}

Methods

get(component: ComponentType): ContextFrom

Reads the context value associated with the given component type.

component

get(component: symbol | ElementType): unknown

Reads the context value associated with the given component key.

component

set(values: C): void

Replaces the current context value for this component instance.

values