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
25 lines
659 B
TypeScript
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);
|
|
};
|