export default (mode = "verbose") =>
  (store) =>
  (next) =>
  (action) => {
    if (mode === "light") {
      console.log("🏃‍ Action:", action.type);
      return next(action);
    }
    console.group(`action: ${action.type}`);
    console.log("action payload", action.payload);
    console.log("state before", store.getState());
    const result = next(action);
    console.log("state after", store.getState());
    console.groupEnd();
    return result;
  };
