import { Store, Dispatch, Action } from "redux";

const crashReporter = (store: Store) => (next: Dispatch) => (
  action: Action
) => {
  const { getState } = store;
  const beforeActionState = getState();
  const result = next(action);
  const afterActionState = getState();
  console.info(
    "action",
    action,
    "beforeState",
    beforeActionState,
    "afterState",
    afterActionState
  );
  return result;
};
export default crashReporter;

import { Store, Dispatch, Action } from "redux";

const logger = (store: Store) => (next: Dispatch) => (action: Action) => {
  const { getState } = store;
  const beforeActionState = getState();
  const result = next(action);
  const afterActionState = getState();
  console.info(
    "action",
    action,
    "beforeState",
    beforeActionState,
    "afterState",
    afterActionState
  );
  return result;
};
export default logger;

Change name to match middlware behavior
Change name to match middlware behavior
