mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
1d45367aa1
* Fixed duplication kve bug * Added semistandard and updated code * Actually got it working * Even better * I think it should work on Windows now
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import {AppContainer} from 'react-hot-loader';
|
|
import {Provider} from 'react-redux';
|
|
import {Tabs} from 'react-tabs';
|
|
import App from './containers/App';
|
|
import './css/index.less';
|
|
import {init as initStore} from './redux/modules';
|
|
import {init as initDB} from '../common/database';
|
|
import {init as initSync} from '../sync';
|
|
import {init as initAnalytics} from '../analytics';
|
|
import {types as modelTypes} from '../models';
|
|
import {getAccountId} from '../sync/session';
|
|
import HTML5Backend from 'react-dnd-html5-backend';
|
|
import {DragDropContext} from 'react-dnd';
|
|
|
|
// Don't inject component styles (use our own)
|
|
Tabs.setUseDefaultStyles(false);
|
|
|
|
(async function () {
|
|
await initDB(modelTypes());
|
|
await initAnalytics(getAccountId());
|
|
|
|
// Create Redux store
|
|
const store = await initStore();
|
|
|
|
const context = DragDropContext(HTML5Backend);
|
|
const DndComponent = context(App);
|
|
const render = Component => {
|
|
ReactDOM.render(
|
|
<AppContainer>
|
|
<Provider store={store}>
|
|
<Component/>
|
|
</Provider>
|
|
</AppContainer>,
|
|
document.getElementById('root')
|
|
);
|
|
};
|
|
|
|
render(DndComponent);
|
|
|
|
// Hot Module Replacement API
|
|
if (module.hot) {
|
|
module.hot.accept('./containers/App', () => {
|
|
render(DndComponent);
|
|
});
|
|
}
|
|
|
|
// Do things that can wait
|
|
process.nextTick(initSync);
|
|
})();
|