backendless-rt-client
Advanced tools
Comparing version 0.0.16 to 0.0.17-next-1
@@ -40,2 +40,10 @@ 'use strict'; | ||
this.onConnectError = function () { | ||
if (!_this.subscriptions.hasActivity() && !_this.methods.hasActivity()) { | ||
_this.disconnect('There are no active subscriptions and methods'); | ||
_this.connectible = true; | ||
} | ||
}; | ||
this.connectOnMethod = function (method) { | ||
@@ -131,3 +139,3 @@ return function () { | ||
this.socketEvents = {}; | ||
this.resetSocketEvents(); | ||
@@ -147,2 +155,8 @@ var socketContext = { | ||
_createClass(RTClient, [{ | ||
key: 'resetSocketEvents', | ||
value: function resetSocketEvents() { | ||
this.socketEvents = {}; | ||
this.addConnectErrorEventListener(this.onConnectError); | ||
} | ||
}, { | ||
key: 'setConfig', | ||
@@ -204,3 +218,3 @@ value: function setConfig(config) { | ||
value: function terminate(reason) { | ||
this.socketEvents = {}; | ||
this.resetSocketEvents(); | ||
@@ -207,0 +221,0 @@ this.subscriptions.reset(); |
@@ -49,3 +49,4 @@ 'use strict'; | ||
LOGGING_MESSAGES: 'LOGGING_MESSAGES' | ||
LOGGING_MESSAGES: 'LOGGING_MESSAGES', | ||
CONSOLE_MESSAGES: 'CONSOLE_MESSAGES' | ||
@@ -52,0 +53,0 @@ //----------- FOR CONSOLE ONLY ------------// |
@@ -45,2 +45,3 @@ 'use strict'; | ||
this.onLoggingMessages = subscription(_constants.RTSubscriptionTypes.LOGGING_MESSAGES).bind(this); | ||
this.onConsoleMessages = subscription(_constants.RTSubscriptionTypes.CONSOLE_MESSAGES).bind(this); | ||
@@ -165,3 +166,3 @@ this.onMessage = onMessage; | ||
/***** LOGGING SUBSCRIPTIONS ****** **/ | ||
/***** CONSOLE SUBSCRIPTIONS ****** **/ | ||
/***************************************** **/ | ||
@@ -248,2 +249,8 @@ | ||
/** */ | ||
/***** LOGGING SUBSCRIPTIONS ****** **/ | ||
/***************************************** **/ | ||
/***************************************** **/ | ||
/***** CONSOLE SUBSCRIPTIONS ****** **/ | ||
/** */ | ||
}]); | ||
@@ -250,0 +257,0 @@ |
@@ -40,2 +40,10 @@ 'use strict'; | ||
this.onConnectError = function () { | ||
if (!_this.subscriptions.hasActivity() && !_this.methods.hasActivity()) { | ||
_this.disconnect('There are no active subscriptions and methods'); | ||
_this.connectible = true; | ||
} | ||
}; | ||
this.connectOnMethod = function (method) { | ||
@@ -131,3 +139,3 @@ return function () { | ||
this.socketEvents = {}; | ||
this.resetSocketEvents(); | ||
@@ -147,2 +155,8 @@ var socketContext = { | ||
_createClass(RTClient, [{ | ||
key: 'resetSocketEvents', | ||
value: function resetSocketEvents() { | ||
this.socketEvents = {}; | ||
this.addConnectErrorEventListener(this.onConnectError); | ||
} | ||
}, { | ||
key: 'setConfig', | ||
@@ -204,3 +218,3 @@ value: function setConfig(config) { | ||
value: function terminate(reason) { | ||
this.socketEvents = {}; | ||
this.resetSocketEvents(); | ||
@@ -207,0 +221,0 @@ this.subscriptions.reset(); |
@@ -49,3 +49,4 @@ 'use strict'; | ||
LOGGING_MESSAGES: 'LOGGING_MESSAGES' | ||
LOGGING_MESSAGES: 'LOGGING_MESSAGES', | ||
CONSOLE_MESSAGES: 'CONSOLE_MESSAGES' | ||
@@ -52,0 +53,0 @@ //----------- FOR CONSOLE ONLY ------------// |
@@ -45,2 +45,3 @@ 'use strict'; | ||
this.onLoggingMessages = subscription(_constants.RTSubscriptionTypes.LOGGING_MESSAGES).bind(this); | ||
this.onConsoleMessages = subscription(_constants.RTSubscriptionTypes.CONSOLE_MESSAGES).bind(this); | ||
@@ -165,3 +166,3 @@ this.onMessage = onMessage; | ||
/***** LOGGING SUBSCRIPTIONS ****** **/ | ||
/***** CONSOLE SUBSCRIPTIONS ****** **/ | ||
/***************************************** **/ | ||
@@ -248,2 +249,8 @@ | ||
/** */ | ||
/***** LOGGING SUBSCRIPTIONS ****** **/ | ||
/***************************************** **/ | ||
/***************************************** **/ | ||
/***** CONSOLE SUBSCRIPTIONS ****** **/ | ||
/** */ | ||
}]); | ||
@@ -250,0 +257,0 @@ |
{ | ||
"name": "backendless-rt-client", | ||
"version": "0.0.16", | ||
"version": "0.0.17-next-1", | ||
"description": "Backendless RT Client for connect to Backendless RT Server", | ||
@@ -5,0 +5,0 @@ "browser": "dist/backendless-rt-client.js", |
@@ -20,3 +20,3 @@ import { NativeSocketEvents } from './constants' | ||
this.socketEvents = {} | ||
this.resetSocketEvents() | ||
@@ -35,3 +35,15 @@ const socketContext = { | ||
resetSocketEvents() { | ||
this.socketEvents = {} | ||
this.addConnectErrorEventListener(this.onConnectError) | ||
} | ||
onConnectError = () => { | ||
if (!this.subscriptions.hasActivity() && !this.methods.hasActivity()) { | ||
this.disconnect('There are no active subscriptions and methods') | ||
this.connectible = true | ||
} | ||
} | ||
connectOnMethod = method => (...args) => { | ||
@@ -100,3 +112,3 @@ if (this.connectible) { | ||
terminate(reason) { | ||
this.socketEvents = {} | ||
this.resetSocketEvents() | ||
@@ -103,0 +115,0 @@ this.subscriptions.reset() |
@@ -45,2 +45,3 @@ export const NativeSocketEvents = { | ||
LOGGING_MESSAGES: 'LOGGING_MESSAGES', | ||
CONSOLE_MESSAGES: 'CONSOLE_MESSAGES' | ||
@@ -47,0 +48,0 @@ //----------- FOR CONSOLE ONLY ------------// |
@@ -179,2 +179,8 @@ import { RTSocketEvents, RTSubscriptionTypes } from './constants' | ||
/***************************************** **/ | ||
/***** CONSOLE SUBSCRIPTIONS ****** **/ | ||
/** */ onConsoleMessages = subscription(RTSubscriptionTypes.CONSOLE_MESSAGES).bind(this) | ||
/***** CONSOLE SUBSCRIPTIONS ****** **/ | ||
/***************************************** **/ | ||
/** CONSOLE's SUBSCRIPTIONS **************************************************** **/ | ||
@@ -181,0 +187,0 @@ /******************************************************************************* **/ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
948062
6437
1