This will cause the LiveState instance to be set on the window as todoLiveState. An element that wishes to connect to an existing LiveState instance uses the context property:
This will find an instance with the specified name (in any scope). This will be handled regardless of order, if the consuming instance is created first a queue of consumers will be created that will be resolved and attached when the providing instance is created.
This typescript class decorator will:
connectedCallbackmethod that sets aliveStateproperty and callsconnectElementdisconnectedCallbackmethod that callsdisconnecton theliveStateinstanceBoth will call inherited callbacks.
The decorator expects to passed an object with the following properties, all of which are optional:
connectElementconnectElementconnectElementContext
As of 0.7.0, we now support sharing LiveState instances via a context. The way this works is that one element will provide an instance like so:
This will cause the LiveState instance to be set on the
windowastodoLiveState. An element that wishes to connect to an existing LiveState instance uses the context property:This will find an instance with the specified name (in any scope). This will be handled regardless of order, if the consuming instance is created first a queue of consumers will be created that will be resolved and attached when the providing instance is created.