Source code

Revision control

Copy as Markdown

Other Tools

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {
applyMiddleware,
createStore,
const {
thunk,
const {
waitUntilService,
const {
DebugTargetsState,
const {
RuntimesState,
const {
UiState,
const {
getDebugTargetCollapsibilities,
const {
getNetworkLocations,
const {
PREFERENCES,
function configureStore() {
const initialState = {
debugTargets: new DebugTargetsState(),
runtimes: new RuntimesState(),
ui: getUiState(),
};
const middleware = applyMiddleware(
thunk(),
debugTargetListenerMiddleware,
errorLoggingMiddleware,
eventRecordingMiddleware,
extensionComponentDataMiddleware,
processComponentDataMiddleware,
tabComponentDataMiddleware,
workerComponentDataMiddleware,
waitUntilService
);
return createStore(rootReducer, initialState, middleware);
}
function getUiState() {
const collapsibilities = getDebugTargetCollapsibilities();
const locations = getNetworkLocations();
const showHiddenAddons = Services.prefs.getBoolPref(
PREFERENCES.SHOW_HIDDEN_ADDONS,
false
);
return new UiState(locations, collapsibilities, showHiddenAddons);
}
exports.configureStore = configureStore;