"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var redux = require("redux");
var redux_logger_1 = require("redux-logger");
var redux_observable_1 = require("redux-observable");
var _1 = require(".");
exports.rootEpic = redux_observable_1.combineEpics(_1.palette.epics, _1.canvas.epics);
exports.rootReducer = redux.combineReducers({
    palette: _1.palette.default,
    canvas: _1.canvas.default
});
var epicMiddleware = redux_observable_1.createEpicMiddleware();
function createStore() {
    var composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || redux.compose;
    var previousState = null;
    var logger = redux_logger_1.createLogger({
        collapsed: function (getState, action) {
            var currentState = getState();
            var changed = previousState !== currentState;
            previousState = currentState;
            return !changed;
        }
    });
    var store = redux.createStore(exports.rootReducer, process.env.NODE_ENV === 'production'
        ? redux.applyMiddleware(epicMiddleware)
        : composeEnhancers(redux.applyMiddleware(epicMiddleware, logger)));
    epicMiddleware.run(exports.rootEpic);
    return store;
}
exports.default = createStore;
//# sourceMappingURL=createStore.js.map