We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there, I'm problem making a very basic mistake in trying to get useWorker to work. Any hints/pointers would be very helpful. Thank you.
Context: I'm trying to use useWorker to parse large CSV files. Unfortunately, I've so far been unable to put a small example to work.
useWorker
Problem: The code sandbox example below gives the following error: ReferenceError: Can't find variable: _toConsumableArray2
ReferenceError: Can't find variable: _toConsumableArray2
Code: https://codesandbox.io/s/hungry-einstein-4gsel?file=/src/App.js
import React, { useState } from "react"; import { useWorker } from "@koale/useworker"; import "./styles.css"; const processArray = () => { const items = [...Array(1000).map((item, offset) => offset)]; return items.sort(); }; export default function App() { const [data, setData] = useState("ready to start"); const [processWorker] = useWorker(processArray); return ( <div className="App"> <h1>Hello CodeSandbox</h1> <h2>Start editing to see some magic happen!</h2> <button onClick={_ => { setData("started"); processWorker().then(_ => setData("finished")); }} > Start </button> <p>{data}</p> </div> ); }
The text was updated successfully, but these errors were encountered:
Hi @marco-m-alves, I don't understand why, but it seems to be a sandbox problem. I ran the project locally and it works!
Here a demo
Sorry, something went wrong.
The demo does not work on Safari Version 13.1.1 (15609.2.9.1.2) — although it works on Chrome Version 83.0.4103.116 (Official Build) (64-bit)
On Safari it get the following errors — see screenshots:
Thanks @marco-m-alves for reporting the Safari bug, now it should be fixed in 3.2.1 🚀
3.2.1
https://github.com/alewin/useWorker/releases/tag/3.2.1
No branches or pull requests
Hi there, I'm problem making a very basic mistake in trying to get useWorker to work. Any hints/pointers would be very helpful. Thank you.
Context:
I'm trying to use
useWorker
to parse large CSV files. Unfortunately, I've so far been unable to put a small example to work.Problem:
The code sandbox example below gives the following error:
ReferenceError: Can't find variable: _toConsumableArray2
Code:
https://codesandbox.io/s/hungry-einstein-4gsel?file=/src/App.js
The text was updated successfully, but these errors were encountered: