separate action dispatch from server

Summary: This diff moves the first small pieces of getting device detection up and running to `server/`, and the wiring between FlipperServer and flipper core / redux is setting up specific events and dispatch actions from there.

Reviewed By: timur-valiev

Differential Revision: D30276776

fbshipit-source-id: b30b996d03c27459815bebeb97b05b5fe5d24bec
This commit is contained in:
Michel Weststrate
2021-08-13 04:01:06 -07:00
committed by Facebook GitHub Bot
parent 4909296d86
commit 6175424d16
6 changed files with 318 additions and 189 deletions

View File

@@ -16,7 +16,7 @@ import {
DevicePluginClient,
PluginClient,
} from 'flipper-plugin';
import {registerNewClient} from '../server/server';
import {handleClientConnected} from '../dispatcher/flipperServer';
import {destroyDevice} from '../reducers/connections';
test('Devices can disconnect', async () => {
@@ -225,7 +225,7 @@ test('new clients replace old ones', async () => {
expect(instance.instanceApi.disconnect).toBeCalledTimes(0);
const client2 = await createClient(device, 'AnotherApp', client.query, true);
registerNewClient(store, client2);
handleClientConnected(store, client2);
expect(client2.connected.get()).toBe(true);
const instance2 = client2.sandyPluginStates.get(plugin.id)!;