Delete communicating and move the missing info into js-plugin-api

Summary: Documents init in the API reference and deletes the now redundant communicating page.

Reviewed By: danielbuechele

Differential Revision: D15198128

fbshipit-source-id: a9b88632b74edd7d9656ed888192db1fbe7f3642
This commit is contained in:
John Knox
2019-05-03 07:07:40 -07:00
committed by Facebook Github Bot
parent f72e4b5122
commit d5573644ac
4 changed files with 5 additions and 49 deletions

View File

@@ -9,14 +9,17 @@ Provided a plugin is setup as defined in [JS Plugin Definiton](js-setup), the ba
Below is a reference of the APIs available to the `FlipperPlugin` class.
## init()
`FlipperPlugin` has an `init()` method which can be overridden by plugins. Use this to make any initial calls to the client, and set up subscriptions. Only after `init()` is called will the `client` object be set.
## Client
This object is provided for communicating with the client plugin, and is accessible using `this.client` inside `FlipperPlugin`. Methods called on it will be routed to the client plugin with the same identifier as the JS plugin.
This object is provided for communicating with the client plugin, and is accessible using `this.client` inside `FlipperPlugin` after `init()` has been called. Methods called on it will be routed to the client plugin with the same identifier as the JS plugin.
### call
`client.call(method: string, params: Object): Promise<Object>`
Call a method on your client plugin implementation.
Call a method on your client plugin implementation. Call `.catch()` on the returned promise to handle any errors returned from the client.
### subscribe
`client.subscribe(method: string, callback: (Object => void)): void`