@skbkontur/cluster-config-client
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -16,3 +16,3 @@ // @flow | ||
/*:: _localConfig: Object */ | ||
/*:: _interval: number */ | ||
/*:: _interval: TimeoutID */ | ||
/*:: _initPromise: ?Promise<*> */ | ||
@@ -64,3 +64,3 @@ /*:: _zone: Object */ | ||
clearInterval() { | ||
clearInterval(this._interval) | ||
clearTimeout(this._interval) | ||
} | ||
@@ -67,0 +67,0 @@ |
@@ -6,7 +6,7 @@ // @flow | ||
class RemoteSettingsProvider extends BaseSettingsProvider { | ||
_getAllSettingsInternal() { | ||
return new Promise((resolve, reject) => this._makeRequest(reject, resolve)) | ||
_getAllSettingsInternal() /* : Promise<Object> */ { | ||
return new Promise(this._makeRequest) | ||
} | ||
_makeRequest(onError /* : * */, onData /* : * */) { | ||
_makeRequest(resolve /* : Function */, reject /* : Function */) { | ||
let chunks = [] | ||
@@ -29,6 +29,6 @@ const { host, port, zone } = this.__settings | ||
const body = Buffer.concat(chunks) | ||
onData(JSON.parse(body.toString('utf-8'))) | ||
resolve(JSON.parse(body.toString('utf-8'))) | ||
}) | ||
res.on('error', onError) | ||
res.on('error', reject) | ||
}) | ||
@@ -35,0 +35,0 @@ .end() |
@@ -0,0 +0,0 @@ // @flow |
{ | ||
"name": "@skbkontur/cluster-config-client", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Клиент к сервису конфигурации кластера контура", | ||
@@ -18,3 +18,3 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"flow-bin": "^0.51.0" | ||
"flow-bin": "^0.67.1" | ||
}, | ||
@@ -21,0 +21,0 @@ "author": "", |
Sorry, the diff of this file is not supported yet
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
6909