mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-27 23:40:28 +05:30
40 lines
923 B
TypeScript
40 lines
923 B
TypeScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import { ContextProvider } from 'app/shell';
|
|
import { Store } from 'app/types';
|
|
import { History } from 'history';
|
|
|
|
import { bsod } from './actions';
|
|
import BSoDContainer from './BSoDContainer';
|
|
|
|
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}>
|
|
<BSoDContainer />
|
|
</ContextProvider>,
|
|
document.getElementById('app'),
|
|
);
|
|
}
|
|
|
|
export function inject({
|
|
store,
|
|
history,
|
|
stopLoading,
|
|
}: {
|
|
store: Store;
|
|
history: History<any>;
|
|
stopLoading: () => void;
|
|
}) {
|
|
injectedStore = store;
|
|
injectedHistory = history;
|
|
onBsod = stopLoading;
|
|
}
|