v0.0.3 - bug fixes

Summary:
couple of bug fixes:
1) we don't want to init plugins on connect - let's wait for init command from flipper
2) on disonnect - "this" didn;t work well with .map() so i switched to old school loop

Reviewed By: jknoxville

Differential Revision: D23623946

fbshipit-source-id: cb3f579a8ee14fedfbe19895f31f77f9e08775d2
This commit is contained in:
Timur Valiev
2020-09-10 08:16:48 -07:00
committed by Facebook GitHub Bot
parent 0e6546b93a
commit 1d55b35dfd
2 changed files with 15 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "flipper-client-sdk",
"version": "0.0.2",
"version": "0.0.3",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"title": "Flipper SDK API",

View File

@@ -121,14 +121,13 @@ export abstract class FlipperClient {
return;
}
this._isConnected = true;
Array.from(this.plugins.values())
.filter((plugin) => plugin.runInBackground())
.map(this.connectPlugin, this);
}
onDisconnect() {
this._isConnected = false;
Array.from(this.plugins.values()).map(this.disconnectPlugin, this);
for (const plugin of this.plugins.values()) {
this.disconnectPlugin(plugin);
}
}
abstract start(appName: string): void;