File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ const MyComponent = () => (
81
81
82
82
- ` url ` {string} (required) Public url to the Web Worker file (or path relative to the root of your domain)
83
83
- ` options ` {Object} Options passed to the Worker constructor
84
- - ` parser ` {Function} Transforms incoming messages (not errors)
84
+ - ` parser ` {Function} Transforms incoming message data (not errors)
85
85
- ` serializer ` {Function} Transforms ` postMessage ` payload before sending
86
86
- ` onMessage ` {Function} Callback function invoked when a message is received, passing message data as argument
87
87
- ` onError ` {Function} Callback function invoked when an error is received, passing error object as argument
@@ -100,8 +100,8 @@ const MyComponent = () => (
100
100
- ` postMessage ` {Function} sends a message to the Web Worker
101
101
102
102
> Note: [ it's recommended] ( https://nolanlawson.com/2016/02/29/high-performance-web-worker-messages/ ) to send and receive
103
- > JSON strings instead of JS objects for improved performance. ` <WebWorker> ` can't do this for you, so you'll have to
104
- > stringify and parse message data yourself if you care about performance .
103
+ > JSON strings instead of JS objects for improved performance. You can use the ` parser ` and ` serializer ` props to have
104
+ > ` <WebWorker> ` deal with this on the client side, but your Worker must still (de)serialize messages on its end .
105
105
106
106
## Examples
107
107
You can’t perform that action at this time.
0 commit comments