telegram-tt/tests/initApp.tsx

25 lines
565 B
TypeScript
Raw Normal View History

2021-04-09 12:29:59 +02:00
import React from '../src/lib/teact/teact';
import TeactDOM from '../src/lib/teact/teact-dom';
import { addReducer, getDispatch } from '../src/lib/teact/teactn';
import '../src/global';
import Main from '../src/components/main/Main';
export default () => {
return new Promise((resolve) => {
const root = document.createElement('div');
document.body.appendChild(root);
getDispatch().init();
getDispatch().initApi();
TeactDOM.render(
<Main />,
root,
);
addReducer('saveSession', () => {
resolve();
});
});
};