Summary: This diff moves a lot of stuff from the client to the server. This diff is fairly large, as a lot of concept closely relate, although some things have split off to the earlier diffs in the stack, or are still to follow (like making intern requests). This diff primarily moves reading and storing settings and GKs from client to server (both flipper and launcher settings). This means that settings are no longer persisted by Redux (which only exists on client). Most other changes are fallout from that. For now settings are just one big object, although we might need to separate settings that are only make sense in an Electron context. For example launcher settings. Reviewed By: passy, aigoncharov Differential Revision: D32498649 fbshipit-source-id: d842faf7a7f03774b621c7656e53a9127afc6192
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
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
|
|
*/
|
|
|
|
// Used responsibly.
|
|
import application from './application';
|
|
import tracking from './tracking';
|
|
import notifications from './notifications';
|
|
import plugins from './plugins';
|
|
import user from './fb-stubs/user';
|
|
import pluginManager from './pluginManager';
|
|
import reactNative from './reactNative';
|
|
import pluginMarketplace from './fb-stubs/pluginMarketplace';
|
|
import pluginDownloads from './pluginDownloads';
|
|
import info from '../utils/info';
|
|
import pluginChangeListener from './pluginsChangeListener';
|
|
|
|
import {Logger} from 'flipper-common';
|
|
import {Store} from '../reducers/index';
|
|
import {Dispatcher} from './types';
|
|
import {notNull} from '../utils/typeUtils';
|
|
|
|
export default function (store: Store, logger: Logger): () => Promise<void> {
|
|
// This only runs in development as when the reload
|
|
// kicks in it doesn't unregister the shortcuts
|
|
const dispatchers: Array<Dispatcher> = [
|
|
application,
|
|
tracking,
|
|
notifications,
|
|
plugins,
|
|
user,
|
|
pluginManager,
|
|
reactNative,
|
|
pluginMarketplace,
|
|
pluginDownloads,
|
|
info,
|
|
pluginChangeListener,
|
|
].filter(notNull);
|
|
const globalCleanup = dispatchers
|
|
.map((dispatcher) => dispatcher(store, logger))
|
|
.filter(Boolean);
|
|
return () => {
|
|
return Promise.all(globalCleanup).then(() => {});
|
|
};
|
|
}
|