Add support for async / custom plugin export
Summary: Sandy plugins can now set up an `onExport` handler to enable customizing the export format of a plugin: `client.onExport(callback: (idler, onStatusMessage) => Promise<state>)` Import will be done in next diff Reviewed By: nikoant Differential Revision: D26124440 fbshipit-source-id: c787c79d929aa8fb484f15a9340d7c87545793cb
This commit is contained in:
committed by
Facebook GitHub Bot
parent
32bde8cace
commit
34c915a739
@@ -20,11 +20,11 @@ import {
|
||||
Message,
|
||||
DEFAULT_MAX_QUEUE_SIZE,
|
||||
} from '../reducers/pluginMessageQueue';
|
||||
import {Idler, BaseIdler} from './Idler';
|
||||
import {IdlerImpl} from './Idler';
|
||||
import {pluginIsStarred, getSelectedPluginKey} from '../reducers/connections';
|
||||
import {deconstructPluginKey} from './clientUtils';
|
||||
import {defaultEnabledBackgroundPlugins} from './pluginUtils';
|
||||
import {batch, _SandyPluginInstance} from 'flipper-plugin';
|
||||
import {batch, Idler, _SandyPluginInstance} from 'flipper-plugin';
|
||||
import {addBackgroundStat} from './pluginStats';
|
||||
|
||||
function processMessageClassic(
|
||||
@@ -168,7 +168,7 @@ export async function processMessageQueue(
|
||||
pluginKey: string,
|
||||
store: MiddlewareAPI,
|
||||
progressCallback?: (progress: {current: number; total: number}) => void,
|
||||
idler: BaseIdler = new Idler(),
|
||||
idler: Idler = new IdlerImpl(),
|
||||
): Promise<boolean> {
|
||||
if (!_SandyPluginInstance.is(plugin) && !plugin.persistedStateReducer) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user