import { isKnownAction } from "./actions";
import { serializeState } from "../utils/serializeState";
function actionMiddleware(middleware) {
  return (api) => (next) => {
    const m = middleware(api)(next);
    return (action) => {
      return isKnownAction(action) ? m(action) : next(action);
    };
  };
}
const middlewareOptions = {
  serializableCheck: false,
  immutableCheck: false
};
const isDevToolsEnabled = () => process.env.NODE_ENV === "development";
function devToolsConfig(options) {
  return isDevToolsEnabled() ? {
    serialize: true,
    stateSanitizer: (state) => serializeState(state),
    ...options
  } : false;
}
export {
  actionMiddleware,
  devToolsConfig,
  middlewareOptions
};
//# sourceMappingURL=toolkit.js.map