vrpc 3.3.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vrpc/VrpcClient.js +4 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vrpc",
3
- "version": "3.3.2",
3
+ "version": "3.4.0",
4
4
  "description": "Variadic Remote Procedure Calls",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -1081,8 +1081,6 @@ class VrpcClient extends EventEmitter {
1081
1081
  event,
1082
1082
  callback
1083
1083
  })
1084
- // indicate that no network call is required
1085
- if (id === null) return null
1086
1084
  wrapped.push(id)
1087
1085
  continue
1088
1086
  } else if (
@@ -1098,8 +1096,6 @@ class VrpcClient extends EventEmitter {
1098
1096
  event,
1099
1097
  callback
1100
1098
  })
1101
- // indicate that no network call is required
1102
- if (id === null) return null
1103
1099
  wrapped.push(id)
1104
1100
  continue
1105
1101
  } else {
@@ -1123,8 +1119,6 @@ class VrpcClient extends EventEmitter {
1123
1119
  event,
1124
1120
  callback: (...args) => emitter.emit(event, ...args)
1125
1121
  })
1126
- // indicate that no network call is required
1127
- if (id === null) return null
1128
1122
  wrapped.push(id)
1129
1123
  continue
1130
1124
  }
@@ -1153,8 +1147,7 @@ class VrpcClient extends EventEmitter {
1153
1147
  }
1154
1148
  // otherwise just add the new callback-handler pair
1155
1149
  this._cachedSubscriptions[topic].push({ callback, handler })
1156
- // indicate that no network call is required
1157
- return null
1150
+ return id
1158
1151
  }
1159
1152
 
1160
1153
  _offRemoteEvent ({ agent, className, instance, event, callback }) {
@@ -1177,8 +1170,7 @@ class VrpcClient extends EventEmitter {
1177
1170
  delete this._cachedSubscriptions[topic]
1178
1171
  return id
1179
1172
  }
1180
- // indicate that no network call is required
1181
- return null
1173
+ return id
1182
1174
  } else {
1183
1175
  this._log.warn(`Can not unsubscribe from non-existing event: ${event}`)
1184
1176
  }
@@ -1225,7 +1217,8 @@ class VrpcClient extends EventEmitter {
1225
1217
 
1226
1218
  _isEmitter (variable) {
1227
1219
  return (
1228
- variable && typeof variable === 'object' &&
1220
+ variable &&
1221
+ typeof variable === 'object' &&
1229
1222
  variable.hasOwnProperty('emitter') &&
1230
1223
  variable.hasOwnProperty('event') &&
1231
1224
  typeof variable.emitter === 'object' &&