Cleanup and some code reuse between Device- and normal Plugins

Summary: Introducing a base abstract class (blegh) to share some life cycle management between Device- and normal plugins. Cleaned up the test utils a bit as well + some old TODO's that now have been taken care of

Reviewed By: nikoant

Differential Revision: D22727089

fbshipit-source-id: 507816f1bfdbc6e7e71d4bd365b881b6710ca917
This commit is contained in:
Michel Weststrate
2020-08-04 07:05:57 -07:00
committed by Facebook GitHub Bot
parent b9c9e89b53
commit 642261c0d0
13 changed files with 275 additions and 353 deletions

View File

@@ -8,7 +8,7 @@
*/
import * as React from 'react';
import {FlipperClient} from '../plugin/Plugin';
import {PluginClient} from '../plugin/Plugin';
import {usePlugin} from '../plugin/PluginContext';
import {createState, useValue} from '../state/atom';
@@ -22,7 +22,7 @@ type Methods = {
currentState(params: {since: number}): Promise<number>;
};
export function plugin(client: FlipperClient<Events, Methods>) {
export function plugin(client: PluginClient<Events, Methods>) {
const connectStub = jest.fn();
const disconnectStub = jest.fn();
const activateStub = jest.fn();