Summary: We're ES6 and `var`s scoping rules are weird. Let's block this. Reviewed By: jknoxville Differential Revision: D16131290 fbshipit-source-id: ba67d16bb8a185a4bb59a657a97b00230dbacafe
28 lines
707 B
JavaScript
28 lines
707 B
JavaScript
/**
|
|
* Copyright 2018-present Facebook.
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
* @format
|
|
*/
|
|
|
|
import type {Store} from '../reducers/index.js';
|
|
import type {Logger} from '../fb-interfaces/Logger.js';
|
|
|
|
import MacDevice from '../devices/MacDevice';
|
|
import WindowsDevice from '../devices/WindowsDevice';
|
|
|
|
export default (store: Store, logger: Logger) => {
|
|
let device;
|
|
if (process.platform === 'darwin') {
|
|
device = new MacDevice();
|
|
} else if (process.platform === 'win32') {
|
|
device = new WindowsDevice();
|
|
} else {
|
|
return;
|
|
}
|
|
store.dispatch({
|
|
type: 'REGISTER_DEVICE',
|
|
payload: device,
|
|
});
|
|
};
|