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
flipper-sdk-api
SDK to build Flipper clients for JS based apps
Installation
yarn add flipper-client-sdk
Usage
Example
class SeaMammalPlugin extends AbsctractFlipperPlugin {
getId(): string {
return 'sea-mammals';
}
runInBackground(): boolean {
return true;
}
newRow(row: {id: string, url: string, title: string}) {
this.connection?.send("newRow", row)
}
}
const flipperClient = newWebviewClient();
cosnt plugin = new SeaMammalPlugin();
flipperClient.addPlugin();
flipperClient.start('Example JS App');
plugin.newRow({id: '1', title: 'Dolphin', url: 'example.com'})