Lime Web Components API Documentation - v6.24.0
    Preparing search index...

    Function ProvideContext

    • Alpha

      Decorator that exposes a property's value to descendants as the named ContextMap key.

      Descendants reading the same key via SelectContext resolve the closest enclosing provider. Reassigning the property propagates the new value to subscribers automatically.

      Type Parameters

      Parameters

      Returns PropertyDecorator

      A PropertyDecorator that wires up the provider.

      @Prop()
      @ProvideContext('user')
      public user: User;
      @State()
      @ProvideContext('user')
      private user: User;