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