useWorker icon indicating copy to clipboard operation
useWorker copied to clipboard

using `kill()` does not fully reset state

Open reviewher opened this issue 2 years ago • 6 comments

https://github.com/alewin/useWorker/blob/master/packages/useWorker/src/useWorker.ts#L64

If the kill method is called from user code, isRunning is never reset and https://github.com/alewin/useWorker/blob/master/packages/useWorker/src/useWorker.ts#L149 error is tripped the next time the worker is used.

setWorkerStatus(WORKER_STATUS.ERROR) or isRunning.current = false in that spot fixes the problem

reviewher avatar Apr 22 '22 09:04 reviewher

In this sorting example also, the kill functionality is not working.

The issue for kill functionality is in version 3 and version 4. It was working fine in version 2

@alewin @zant

ashish-r avatar May 17 '22 05:05 ashish-r

Created the PR for fix here

@alewin @zant please review

ashish-r avatar May 19 '22 11:05 ashish-r

Still the same problem, any update on this issue?

Arif-un avatar Aug 13 '22 07:08 Arif-un

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。

ghost avatar Aug 13 '22 07:08 ghost

@Arif-un this pr is still not merged.

@alewin @zant guys the PR is approved, anything I should change/take care of? If not can we please merge?

ashish-r avatar Aug 13 '22 08:08 ashish-r

Is this issue fixed?

sheron184 avatar Jul 23 '23 10:07 sheron184