23 lines
573 B
TypeScript
Raw Normal View History

import request from 'app/services/request';
import logger from 'app/services/logger';
import { Store } from 'app/reducers';
import { History } from 'history';
2016-07-29 22:29:27 +03:00
import dispatchBsod, { inject } from './dispatchBsod';
2017-02-22 20:33:15 +02:00
import BsodMiddleware from './BsodMiddleware';
2016-07-29 22:29:27 +03:00
export default function factory({
2020-05-24 02:08:24 +03:00
store,
history,
stopLoading,
}: {
2020-05-24 02:08:24 +03:00
store: Store;
history: History<any>;
stopLoading: () => void;
}) {
2020-05-24 02:08:24 +03:00
inject({ store, history, stopLoading });
2016-07-29 22:29:27 +03:00
2020-05-24 02:08:24 +03:00
// do bsod for 500/404 errors
request.addMiddleware(new BsodMiddleware(dispatchBsod, logger));
2016-07-29 22:29:27 +03:00
}