Beta
Decorator that consumes a ContextMap key, assigning the resolved value to the decorated property and updating it on every change. Compose with Stencil's @State() to trigger a re-render.
@State()
The ContextMap key being consumed.
The ContextMap key to consume.
A PropertyDecorator that wires up the subscription.
PropertyDecorator
import { State } from '@stencil/core';import { SelectContext, User } from '@limetech/lime-web-components';class MyComponent { @State() @SelectContext('user') private user: User;} Copy
import { State } from '@stencil/core';import { SelectContext, User } from '@limetech/lime-web-components';class MyComponent { @State() @SelectContext('user') private user: User;}
Decorator that consumes a ContextMap key, assigning the resolved value to the decorated property and updating it on every change. Compose with Stencil's
@State()to trigger a re-render.