alewin/useWorker

Uncaught ReferenceError: _toConsumableArray2 is not defined/

buitrbao222 opened this issue · 2 comments

[Required] Describe the bug
Bug happens when using spread syntax in the function passed to useWorker.

[Optional] To Reproduce
Steps to reproduce the behavior:

  1. Write a function that uses spread syntax
  2. Pass that function to useWorker to create a worker
  3. Run worker
  4. See error

[Required] Expected behavior
The worker to run normally without errors.

[Optional] Screenshots
If applicable, add screenshots to help explain your problem.

[Optional] Device (please complete the following information):

  • OS: Windows
  • Browser chrome
  • Version 84.0.4147.125 (Official Build) (64-bit)

[Optional] context
Here's the Codesandbox:
https://codesandbox.io/s/testing-useworker-9rw9j

check if the solution mentioned in #87 fixes your issue

Mentioned here: #87 (comment)

You can try to write code in a way that, on transpiling should not make your function impure.