import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';

import App from './App';
import WebWorkerHelper from "./util/WebWorkerHelper";
import WebWorker from "./worker/WebWorker";

// web worker ?
// https://stackoverflow.com/questions/47475360/creating-a-web-worker-inside-react

const worker: Worker = new WebWorkerHelper(WebWorker) as Worker;
worker.addEventListener("message", e => {
    console.log("Received response:");
    console.log(e.data);
}, false);
worker.postMessage("bar");

console.log(worker);


ReactDOM.render(<App/>, document.getElementById('root'));
