Module: bajaux/mixin/subscriberMixIn

A widget that implements this MixIn will be able to
load and subscribe to Components. The MixIn name is 'subscriber'.

Requires

Members


<static> target.getSubscriber

Returns this widget's subscriber.

Methods


<static> target.destroy()

Overrides the default widget destroy method. This method ensures
all handlers are removed by the Subscriber when the widget is destroyed.

See:
Returns:

A promise resolved once everything has been destroyed.

Type
Promise

<static> target.load(value [, params])

Override the default widget load method. Loads a value into the widget.
If the value is a Component, then it will be subscribed (unless
autoSubscribe is false).

This function supports the contract defined in batchLoadMixin.

Parameters:
Name Type Argument Description
value *

The value for the Widget to load.

params Object <optional>
Properties
Name Type Argument Description
batch baja.comm.Batch <optional>

component subscription will
use this batch, if provided

progressCallback function <optional>

a function to be called when
subscription progress occurs

See:
Returns:

A promise that's resolved once the value has been
fully loaded.

Type
Promise

<static> target.resolve(data [, resolveParams])

Overrides resolve and injects a Subscriber into the ORD
resolution so it's subscribed.

Parameters:
Name Type Argument Description
data

Specifies some data used to resolve a load value
so load(value) can be called on the widget.

resolveParams Object <optional>

An Object Literal used for ORD
resolution. This parameter is designed to be used internally by bajaux
and shouldn't be used by developers.

Returns:
Type
Promise

<static> target.setEnabled(enabled)

Overrides the default widget setEnabled method. If a widget is enabled
then a subscription for the value is started (unless autoSubscribe
returns false). If the value is unsubscribed then an unsubscription for
the value is attempted.

Parameters:
Name Type Description
enabled Boolean
See:
Returns:

A promise resolved once the widget is enabled and the
loaded component is subscribed

Type
Promise