Creates a WebWorker based on a function, useful for offloading heavy tasks easily
The useWorkerFunction
function uses CancellablePromise
Function
true
Function we want to execute in the worker options WebWorkerFunctionOptions
false
undefined
Options for the webworker # State
The useWorkerFunction
function exposes the following reactive state:
Promise
Current worker process result any
Resolved value loading boolean
Waiting for the worker to finish error any
Promise error cancelled boolean
Was cancelled # Methods
The useWorkerFunction
function exposes the following methods:
exec(args?)
Resolves new promise cancel(error?)
Terminates the worker # Example Sort
time: 1634454087218
If UI thread is working the refresh rate should go down and the time will stopTimeout
Numbers: []... []
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4