Update architecture.mdx and client-plugin-lifecycle.mdx in docs (#1459)
Summary: Removed basic grammatical errors in two docs files: architecture.mdx and client-plugin-lifecycle.mdx ## Changelog Update architecture.mdx and client-plugin-lifecycle.mdx docs Pull Request resolved: https://github.com/facebook/flipper/pull/1459 Test Plan: There is only text change in documentation. The code is unchanged. Reviewed By: cekkaewnumchai Differential Revision: D23101962 Pulled By: passy fbshipit-source-id: 24d9233d67a19745696b40ea6c2d3ac2d26231c3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f743940d02
commit
eb09f7903b
@@ -6,7 +6,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
|
||||
There are two types of client plugin: Regular and Background plugins. We recommend starting off as a regular plugin and switching it to a background plugin if necessary.
|
||||
|
||||
For both types of plugin, we recommend starting work after `onConnect` is called, and terminating it after `onDisconnect`, when possible. This prevents wasted computation when Flipper isn't connected. If the plugin needs to keep track of events that occur before it gets connected (such as initial network requests on app startup), you should do so in the plugin constructor (or ideally in a separate class).
|
||||
For both types of plugin, we recommend starting work after `onConnect` is called and terminating it after `onDisconnect`, when possible. This prevents wasted computation when Flipper isn't connected. If the plugin needs to keep track of events that occur before it gets connected (such as initial network requests on app startup), you should do so in the plugin constructor (or ideally in a separate class).
|
||||
|
||||
## Regular Plugin Lifecycle
|
||||
For regular plugins, `onConnect` and `onDisconnect` are triggered when the user opens the plugin in the Flipper UI, and when they switch to another plugin, respectively.
|
||||
@@ -15,7 +15,7 @@ For regular plugins, `onConnect` and `onDisconnect` are triggered when the user
|
||||
## Background Plugin Lifecycle
|
||||
For background plugins, `onConnect` is called when Flipper first connects, and `onDisconnect` when it disconnects. The user does not need to be viewing the plugin for it to send messages; they will be queued up until the next time the user opens the plugin where they will be processed.
|
||||
|
||||
Even for background plugins, `onDisconnect` and `onConnect` may be called on a plugin (e.g. if the user restarts Flipper). Plugins should handle this accordingly by making sure to resend any important data to the reconnected instance.
|
||||
Even for background plugins, `onDisconnect` and `onConnect` may be called on a plugin (e.g., if the user restarts Flipper). Plugins should handle this accordingly by making sure to resend any important data to the reconnected instance.
|
||||
<div class="warning">
|
||||
Note that a plugin must be enabled by the user for its messages to be queued up.
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user