2019-12-26 17:48:58 +05:30
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2020-07-22 15:31:12 +05:30
|
|
|
|
2019-12-26 17:48:58 +05:30
|
|
|
import { ContextProvider } from 'app/shell';
|
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';
|
|
|
|
|
|
|
|
import { bsod } from './actions';
|
2020-01-16 02:09:53 +05:30
|
|
|
import BSoDContainer from './BSoDContainer';
|
2019-12-26 17:48:58 +05:30
|
|
|
|
|
|
|
let injectedStore: Store;
|
|
|
|
let injectedHistory: History<any>;
|
|
|
|
let onBsod: undefined | (() => void);
|
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
export default function dispatchBsod(store = injectedStore, history = injectedHistory) {
|
|
|
|
store.dispatch(bsod());
|
|
|
|
onBsod && onBsod();
|
2019-12-26 17:48:58 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
ReactDOM.render(
|
|
|
|
<ContextProvider store={store} history={history}>
|
|
|
|
<BSoDContainer />
|
|
|
|
</ContextProvider>,
|
|
|
|
document.getElementById('app'),
|
|
|
|
);
|
2019-12-26 17:48:58 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export function inject({
|
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
|
|
|
injectedStore = store;
|
|
|
|
injectedHistory = history;
|
|
|
|
onBsod = stopLoading;
|
2019-12-26 17:48:58 +05:30
|
|
|
}
|