Skip to content

Commit b82320c

Browse files
authored
Merge pull request #191 from ainblockchain/release/v1.10.2
Upgrade version to 1.10.2
2 parents 4924cf6 + cf1c440 commit b82320c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

__tests__/event_manager.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ describe('Event Handler', function() {
2929
ain.em.disconnect();
3030
});
3131

32+
describe('Channel connection', () => {
33+
it('isConnected()', () => {
34+
expect(ain.em.isConnected()).toBe(true);
35+
});
36+
});
37+
3238
describe('BLOCK_FINALIZED', () => {
3339
it('Subscribe to BLOCK_FINALIZED', (done) => {
3440
eventFilterId = ain.em.subscribe('BLOCK_FINALIZED', {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ainblockchain/ain-js",
3-
"version": "1.10.1",
3+
"version": "1.10.2",
44
"description": "",
55
"main": "lib/ain.js",
66
"scripts": {

src/event-manager/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ export default class EventManager {
2828
this._eventChannelClient = new EventChannelClient(ain, this._eventCallbackManager);
2929
}
3030

31+
/**
32+
* Returns whether the client in connection.
33+
*/
34+
isConnected(): boolean {
35+
return this._eventChannelClient.isConnected;
36+
}
37+
3138
/**
3239
* Opens a new event channel.
3340
* @param {DisconnectionCallback} disconnectionCallback The disconnection callback function.

0 commit comments

Comments
 (0)