2019-12-08 00:32:00 +05:30
|
|
|
import request from 'app/services/request';
|
|
|
|
import logger from 'app/services/logger';
|
2020-07-22 15:31:12 +05:30
|
|
|
import { Store } from 'app/types';
|
2019-12-26 17:48:58 +05:30
|
|
|
import { History } from 'history';
|
2016-07-30 00:59:27 +05:30
|
|
|
|
|
|
|
import dispatchBsod, { inject } from './dispatchBsod';
|
2017-02-23 00:03:15 +05:30
|
|
|
import BsodMiddleware from './BsodMiddleware';
|
2016-07-30 00:59:27 +05:30
|
|
|
|
2019-12-26 17:48:58 +05:30
|
|
|
export default function factory({
|
2020-05-24 04:38:24 +05:30
|
|
|
store,
|
|
|
|
history,
|
|
|
|
stopLoading,
|
2019-12-26 17:48:58 +05:30
|
|
|
}: {
|
2020-05-24 04:38:24 +05:30
|
|
|
store: Store;
|
|
|
|
history: History<any>;
|
|
|
|
stopLoading: () => void;
|
2019-12-26 17:48:58 +05:30
|
|
|
}) {
|
2020-05-24 04:38:24 +05:30
|
|
|
inject({ store, history, stopLoading });
|
2016-07-30 00:59:27 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
// do bsod for 500/404 errors
|
|
|
|
request.addMiddleware(new BsodMiddleware(dispatchBsod, logger));
|
2016-07-30 00:59:27 +05:30
|
|
|
}
|