Migrate dispatcher index to tsx

Summary: As per the title

Reviewed By: jknoxville, passy

Differential Revision: D16690303

fbshipit-source-id: fa78ea1e3f288249676d5a6423e5d0f0a6e427a4
This commit is contained in:
Pritesh Nandgaonkar
2019-08-09 07:47:34 -07:00
committed by Facebook Github Bot
parent 86642816fb
commit c43beb53d1
4 changed files with 12 additions and 12 deletions

40
src/dispatcher/index.tsx Normal file
View File

@@ -0,0 +1,40 @@
/**
* 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 androidDevice from './androidDevice';
import iOSDevice from './iOSDevice';
import desktopDevice from './desktopDevice';
import application from './application';
import tracking from './tracking';
import server from './server';
import notifications from './notifications';
import plugins from './plugins';
import user from './user';
import {Logger} from '../fb-interfaces/Logger.js';
import {Store} from '../reducers/index';
import {Dispatcher} from './types';
export default function(store: Store, logger: Logger): () => Promise<void> {
const dispatchers: Array<Dispatcher> = [
application,
androidDevice,
iOSDevice,
desktopDevice,
tracking,
server,
notifications,
plugins,
user,
];
const globalCleanup = dispatchers
.map(dispatcher => dispatcher(store, logger))
.filter(Boolean);
return () => {
return Promise.all(globalCleanup).then(() => {});
};
}