Files
flipper/desktop/flipper-ui-core/src/reducers/launcherSettings.tsx
Andrey Goncharov 17ab7a86ef Use getRenderHost from flipper-frontned-core in flipper-ui-core
Summary: See D37139129

Reviewed By: lblasa

Differential Revision: D37236435

fbshipit-source-id: 927e9f741bfedb65165f5d24f0acfb775925cdc7
2022-06-20 12:18:40 -07:00

36 lines
862 B
TypeScript

/**
* Copyright (c) Meta Platforms, Inc. and 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 {LauncherSettings} from 'flipper-common';
import {getRenderHostInstance} from 'flipper-frontend-core';
import {Actions} from './index';
export type Action = {
type: 'UPDATE_LAUNCHER_SETTINGS';
payload: LauncherSettings;
};
export default function reducer(
state: LauncherSettings = getRenderHostInstance().serverConfig
.launcherSettings,
action: Actions,
): LauncherSettings {
if (action.type === 'UPDATE_LAUNCHER_SETTINGS') {
return action.payload;
}
return state;
}
export function updateLauncherSettings(settings: LauncherSettings): Action {
return {
type: 'UPDATE_LAUNCHER_SETTINGS',
payload: settings,
};
}