File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ export type CloudFactoryOptions = (APIOptions | CredentialsOptions | BrowserOpti
8
8
9
9
export interface IArduinoIoTCloudFactory {
10
10
connect ( options : APIOptions & Partial < CloudOptions > ) : Promise < IMultiPropertiesCloudClient > ;
11
- connect ( options : CredentialsOptions & Partial < CloudOptions > ) : Promise < ISinglePropertyCloudClient > ;
12
11
connect ( options : BrowserOptions & Partial < CloudOptions > ) : Promise < IMultiPropertiesCloudClient > ;
12
+ connect ( options : CredentialsOptions & Partial < CloudOptions > ) : Promise < ISinglePropertyCloudClient > ;
13
13
}
Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ export class BaseCloudClient<T extends IConnection = IConnection> implements ICl
63
63
if ( err ) throw new Error ( `subscription failed: ${ err . toString ( ) } ` ) ;
64
64
65
65
subscription = this . connection . messages . pipe ( filter ( ( v ) => v . topic === topic ) ) . subscribe ( ( v ) => subject . next ( v ) ) ;
66
+ this . options . onConnected ( ) ;
66
67
} ) ;
67
68
68
69
const originalMethod = subject . unsubscribe ;
69
70
subject . unsubscribe = ( ) => {
70
71
subscription . unsubscribe ( ) ;
71
72
originalMethod ( ) ;
73
+ this . options . onDisconnect ( ) ;
72
74
} ;
73
75
74
76
return subject ;
You can’t perform that action at this time.
0 commit comments