ISubscription interface

Member of ININ.Addins.IC Since 2016 R1 API Version 1

Represents a subscription.

As a best practice, events should be bound by using on or once before calling subscribe. There may be events that fire before the IPromise returned from subscribe is resolved.

Methods

dispose()

Since 2016 R1 API Version 1

Informs the application that this object is no longer required and can be cleaned up. No further function calls from this instance will be accepted by the application.

off(key[, handler]) :ININ.Addins.IEventHandler

Since 2016 R1 API Version 1

Unbinds the optionally specified handler from the event key.

Inherited from ININ.Addins.IEventHandler#off

Parameters

Name Type Description
key String

The event key.

handler function Optional

The callback handler.

Returns

This ININ.Addins.IEventHandler instance.

Type
ININ.Addins.IEventHandler

on(key, handler) :ININ.Addins.IEventHandler

Since 2016 R1 API Version 1

Binds the specified event key to the callback that can be emitted 1 or more times.

Inherited from ININ.Addins.IEventHandler#on

Parameters

Name Type Description
key String

The event key.

handler function

The callback handler.

Returns

This ININ.Addins.IEventHandler instance.

Type
ININ.Addins.IEventHandler

once(key, handler) :ININ.Addins.IEventHandler

Since 2016 R1 API Version 1

Binds the specified event key to the callback that can be emitted only once, then removed.

Inherited from ININ.Addins.IEventHandler#once

Parameters

Name Type Description
key String

The event key.

handler function

The callback handler.

Returns

This ININ.Addins.IEventHandler instance.

Type
ININ.Addins.IEventHandler

subscribe(args) :IPromise

Async Since 2016 R1 API Version 1

Creates or updates the subscription owned by this instance.

The application must be connected to Interaction Center. Callers can verify the connection by inspecting the ININ.Addins.IC.sessionInfo object.

Parameters

Name Type Description
args object

The subscription request. This is dependent on each kind of subscription.

Returns

A IPromise that is resolved when the subscription is created or updated.

Type
IPromise

unsubscribe() :IPromise

Async Since 2016 R1 API Version 1

Removes the subscription owned by this instance.

Returns

A IPromise that is resolved when the subscription is removed.

Type
IPromise