Class: Subscription
A convenience API for managing an individual subscription.
Hierarchy
↳
Subscription
Properties
erc1271ContractAddress
• Readonly
erc1271ContractAddress: undefined
| EthereumAddress
streamPartId
• Readonly
streamPartId: StreamPartID
Methods
[asyncIterator]
▸ [asyncIterator](): AsyncIterator
\<Message
, any
, undefined
>
Returns
AsyncIterator
\<Message
, any
, undefined
>
Inherited from
off
▸ off\<E
>(eventName
, listener
): void
Removes an event listener from the subscription.
Type parameters
Name | Type |
---|---|
E | extends keyof SubscriptionEvents |
Parameters
Name | Type | Description |
---|---|---|
eventName | E | event name, see SubscriptionEvents for options |
listener | SubscriptionEvents [E ] | the callback function to remove |
Returns
void
on
▸ on\<E
>(eventName
, listener
): void
Adds an event listener to the subscription.
Type parameters
Name | Type |
---|---|
E | extends keyof SubscriptionEvents |
Parameters
Name | Type | Description |
---|---|---|
eventName | E | event name, see SubscriptionEvents for options |
listener | SubscriptionEvents [E ] | the callback function |
Returns
void
once
▸ once\<E
>(eventName
, listener
): void
Adds an event listener to the subscription that is invoked only once.
Type parameters
Name | Type |
---|---|
E | extends keyof SubscriptionEvents |
Parameters
Name | Type | Description |
---|---|---|
eventName | E | event name, see SubscriptionEvents for options |
listener | SubscriptionEvents [E ] | the callback function |
Returns
void
unsubscribe
▸ unsubscribe(): Promise
\<void
>
Unsubscribes this subscription.
Returns
Promise
\<void
>
Remarks
The instance should not be used after calling this.