import { createStore as createReduxStore, applyMiddleware } from "redux";
import { rootReducer } from "./reducers/rootReducer";
import { FEAGlobals } from "../common/Globals";
/**
 * Logging middleware that logs each action (and the resulting state).
 * Adapted from https://redux.js.org/api/applymiddleware/
 */
const logger = ({ getState }) => (next) => (action) => {
    // Call the next dispatch method in the middleware chain.
    const returnValue = next(action);
    FEAGlobals.FSBL.Clients.Logger.system.debug("Toolbar Action", action, "Current State", getState());
    // This will likely be the action itself, unless
    // a middleware further in chain changed it.
    return returnValue;
};
export const createStore = () => createReduxStore(rootReducer, undefined, applyMiddleware(logger));
export const store = createStore();
//# sourceMappingURL=store.js.map