<reponame>alisour/python-examples<filename>m10_messaging_ui/node_modules/react-beautiful-dnd/src/debug/middleware/user-timing.js<gh_stars>0// @flow
import type { Action } from '../../state/store-types';

export default () => (next: Action => mixed) => (action: Action): any => {
  const title: string = `👾 redux (action): ${action.type}`;
  const startMark: string = `${action.type}:start`;
  const endMark: string = `${action.type}:end`;

  performance.mark(startMark);
  const result: mixed = next(action);
  performance.mark(endMark);

  performance.measure(title, startMark, endMark);

  return result;
};
