@startup-booster/move
Advanced tools
Comparing version 0.1.14 to 0.1.15
13
move.js
@@ -5,4 +5,4 @@ const { EventEmitter } = require('events'); | ||
/** @type {function(string): MoveClient} */ | ||
const connect = url => { | ||
/** @type {function(string, MoveOptions): MoveClient} */ | ||
const connect = (url, options = {}) => { | ||
const eventEmitter = new EventEmitter(); | ||
@@ -12,2 +12,3 @@ const listeners = {}; | ||
path: '/move', | ||
auth: options.auth, | ||
}); | ||
@@ -99,5 +100,11 @@ | ||
if (listeners[path]) { | ||
console.log(`Listen: adding handler for ${path}`); | ||
listeners[path].handlers.add(callback); | ||
rpc('get', path).then(value => { | ||
console.log(`Got ${path}`, value); | ||
callback(value); | ||
}); | ||
return; | ||
} | ||
console.log(`Listen: first handler for ${path}`); | ||
listeners[path] = { | ||
@@ -129,3 +136,3 @@ handlers: new Set([callback]), | ||
index: 0, | ||
} | ||
}; | ||
await rpc('collectionListen', collection); | ||
@@ -132,0 +139,0 @@ }, |
{ | ||
"name": "@startup-booster/move", | ||
"version": "0.1.14", | ||
"version": "0.1.15", | ||
"main": "move.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5612
27
185
14