Files
flipper/desktop/app/src/server/desktopDevice.tsx
Michel Weststrate 6175424d16 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
2021-08-13 04:02:32 -07:00

25 lines
659 B
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import MacDevice from '../server/devices/MacDevice';
import WindowsDevice from '../server/devices/WindowsDevice';
import {FlipperServer} from './FlipperServer';
export default (flipperServer: FlipperServer) => {
let device;
if (process.platform === 'darwin') {
device = new MacDevice();
} else if (process.platform === 'win32') {
device = new WindowsDevice();
} else {
return;
}
flipperServer.emit('device-connected', device);
};