-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I saw you were taking over the @koale/useworker project and thanks for that. I, anyway, have a problem you said would be fixed with your version
Here is a page to reproduce this in a nextjs 13 environment (pages router)
import rules from '@betagouv/france-chaleur-urbaine-publicodes';
import Engine from 'publicodes';
import { useWorkerFunc } from 'use-react-workers';
const createEngine = () => {
return new Engine(rules);
};
const SimulateurPage = () => {
// const engine = useSimulatorEngine();
const [sortWorker, { status }] = useWorkerFunc(createEngine);
const runCreateEngine = async () => {
const result = await sortWorker(); // non-blocking UI
console.log(result);
};
return (
<>
<button type="button" onClick={runCreateEngine}>
Run Sort
</button>
{status}
</>
);
};
export default SimulateurPage;
Thanks for your help
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working