<commit_before>/**
 * 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';
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(() => {});
  };
}
<commit_msg>Use androidEnabled setting in dispatcher<commit_after>/**
 * 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';
import {Store} from '../reducers/index';
import {Dispatcher} from './types';
import {notNull} from '../utils/typeUtils';

export default function(store: Store, logger: Logger): () => Promise<void> {
  const dispatchers: Array<Dispatcher> = [
    application,
    store.getState().settingsState.enableAndroid ? androidDevice : null,
    iOSDevice,
    desktopDevice,
    tracking,
    server,
    notifications,
    plugins,
    user,
  ].filter(notNull);
  const globalCleanup = dispatchers
    .map(dispatcher => dispatcher(store, logger))
    .filter(Boolean);
  return () => {
    return Promise.all(globalCleanup).then(() => {});
  };
}

{'fraction_non_alphanumeric': 0.1335286730849728, 'fraction_numerical': 0.0033486814566764337, 'mean_word_length': 4.010482180293501, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5596869', 'n_tokens_mistral': 644, 'n_tokens_neox': 621, 'n_words': 219}