Version: v3.6.0
#
@rooks/use-worker#
Worker hook for React.
#
Installation#
Importing the hook#
Usage#
ArgumentsArguments | Type | Description | Default value |
---|---|---|---|
scriptPath | string | Path to the script file that a new Worker is to be created with | undefined |
options | Object | Options object within which onMessage and onMessageError options can be passed to communicate with the worker | {onMessage: () => {},,onMessageError: () => {}} |
#
Returned ObjectThe worker instance is returned.