Type alias LiveStateDecoratorOptions

LiveStateDecoratorOptions: {
    attributes?: string[];
    context?: string;
    events?: {
        receive?: string[];
        send?: string[];
    };
    params?: object;
    properties?: string[];
    provide?: {
        name: string | undefined;
        scope: object;
    };
    topic?: string;
    url?: string;
}

Type declaration

  • Optional attributes?: string[]

    A list of attribute names, each of which will be updated from the state on any state chnages.

  • Optional context?: string

    This will use an existing liveState instance that has been provided with the given name, rather than creating one.

  • Optional events?: {
        receive?: string[];
        send?: string[];
    }
    • Optional receive?: string[]
    • Optional send?: string[]
  • Optional params?: object

    will be sent as params on channel join

  • Optional properties?: string[]

    A list of property names, each of which will be updated from the state on any state chnages.

  • Optional provide?: {
        name: string | undefined;
        scope: object;
    }

    This will create an instance in the given scope with the specified name. For example, a scope of window and a name of liveState will create window.liveState Instances so provided can be found by other elements using a context attribute whose value matches the name used by the provider. This will work regardless of which element occurs first (or highest) in the DOM

    • name: string | undefined
    • scope: object
  • Optional topic?: string

    The topic for the channel

  • Optional url?: string

    The end point to connect to, should be a websocket url (ws or wss)

Generated using TypeDoc