adding selectPlugin API to plugins

Summary:
Allow linking from one plugin to another. Adds a prop `selectPlugin` to the plugin that can be passed a pluginID and an optional `deepLinkPayload`.

The return value tells you if switching the plugin was successful.

```
selectPlugin: (pluginID: string, deepLinkPayload: ?string) => boolean,
```

Reviewed By: passy

Differential Revision: D10483925

fbshipit-source-id: 6f821277150b2db185b7d545c310214a11432eac
This commit is contained in:
Daniel Büchele
2018-10-22 06:58:02 -07:00
committed by Facebook Github Bot
parent b1c735c40d
commit 86c796a706
3 changed files with 34 additions and 9 deletions

View File

@@ -40,6 +40,7 @@ export type Props<T> = {
setPersistedState: (state: $Shape<T>) => void,
target: PluginTarget,
deepLinkPayload: ?string,
selectPlugin: (pluginID: string, deepLinkPayload: ?string) => boolean,
};
export class FlipperBasePlugin<