This API is dedicated for developer of Builders.
Decorates the property of the gateway.
Subscribe to a Message Event.
the type of the event
the listener
the options
When used as a decorator, returns a fresh Subscription builder to decorate a method.
Generated using TypeDoc
The builder handles the integration of the Event/Message Driven approach provided natively by
<ceb/>
. Its purpose is to provide a quick and efficient way to interact with the Gateway within the Custom Element. Therefore, it is easy to execute queries to get data, execute commands to generate side effects and finally listen to events to react on side effects.First, the Gateway is created and set to a readonly property, by default its name is
gateway
. By default, the global channel iswindow
, it can be overridden with {@link AbstractGatewayBuilder.global}Then, subscriptions can be registered with AbstractGatewayBuilder.subscribe. When the builder is used as a decorator, then AbstractGatewayBuilder.subscribe provides an instance of GatewaySubscriptionBuilder which can be used to easily configure a subscription.
The gateway starts when the Custom Element is connected, c.f.
connectedCallback
and, stops when it is disconnected, c.f.disconnectedCallback
.The builder can be used many times by Custom Element. There will be a unique Gateway instance per properties.
type of the Custom Element