File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ This example utilises a public device defined in IOStash.
4444 - ` subscribeLocation(deviceId,cb()) ` - Subscribes to location data from the specified device.
4545 - ` subscribeActions(deviceId,cb()) ` - Subscribes to device trigger action of the specified device.
4646 - ` subscribeCustomData(deviceId,cb()) ` - Subscribes to custom data sent to the device.
47+ - ` onDisconnect(cb()) ` - Fires when the connection to the server is lost.
4748
4849** Notes**
4950
Original file line number Diff line number Diff line change @@ -7403,6 +7403,12 @@ iostash = function () {
74037403 } )
74047404 }
74057405
7406+ onDisconnect = function ( callbacl ) {
7407+ socket . on ( 'disconnect' , function ( ) {
7408+ callback ( )
7409+ } )
7410+ }
7411+
74067412 return {
74077413 'init' : init ,
74087414 'initPublic' : initPublic ,
@@ -7414,7 +7420,9 @@ iostash = function () {
74147420 'unSubscribeDataPoint' : unSubscribeDataPoint ,
74157421 'subscribeActions' : subscribeActions ,
74167422 'subscribeCustomData' : subscribeCustomData ,
7417- 'subscribeLocation' : subscribeLocation
7423+ 'subscribeLocation' : subscribeLocation ,
7424+ 'onDisconnect' : onDisconnect
7425+
74187426 }
74197427
74207428} ( )
You can’t perform that action at this time.
0 commit comments