import {Middleware} from '@reduxjs/toolkit';

const phenixWebSocketMiddleware: Middleware = storeApi => next => action => {
  console.log('phenixWebSocketMiddleware', action);
  if (typeof action === 'function') {
    return action(storeApi.getState(), storeApi.dispatch);
  }

  return next(action);
};

export default phenixWebSocketMiddleware;
