Add lifecycle diagrams for regular and background plugins

Summary:
I think this'll clarify how to use the lifecycle methods.

Diagram edit link: https://excalidraw.com/#json=5696112581148672,nDwD6t1BNXVreQ8YE8917g

Reviewed By: mweststrate

Differential Revision: D20645302

fbshipit-source-id: 0814dbe8421cfe8e85c297bd5bfb4a8f1a83c353
This commit is contained in:
John Knox
2020-03-25 12:46:52 -07:00
committed by Facebook GitHub Bot
parent 4d866b0327
commit 0275d35233
6 changed files with 28 additions and 1 deletions

View File

@@ -200,7 +200,7 @@ addPlugin({
## Background Plugins
In some cases you may want to provide data to Flipper even when your plugin is not currently active. Returning true in `runInBackground()` will result in `onConnect` being called as soon as Flipper connects, and allow you to use the connection at any time.
In some cases you may want to provide data to Flipper even when your plugin is not currently active. Returning true in `runInBackground()` will result in `onConnect` being called as soon as Flipper connects, and allow you to use the connection at any time. See the [Client Plugin Lifecycle](client-plugin-lifecycle) for more details.
This should be used in combination with a `persistedStateReducer` on the desktop side. See the [JS Plugin API](js-plugin-api#background-plugins) for details.