accounts-frontend/packages/app/components/ui/bsod/factory.ts

23 lines
555 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-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
export default function factory({
store,
history,
stopLoading,
}: {
store: Store;
history: History<any>;
stopLoading: () => void;
}) {
inject({ store, history, stopLoading });
2016-07-30 00:59:27 +05:30
// do bsod for 500/404 errors
request.addMiddleware(new BsodMiddleware(dispatchBsod, logger));
2016-07-30 00:59:27 +05:30
}