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 = () => (
8181
8282- ` url ` {string} (required) Public url to the Web Worker file (or path relative to the root of your domain)
8383- ` 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)
8585- ` serializer ` {Function} Transforms ` postMessage ` payload before sending
8686- ` onMessage ` {Function} Callback function invoked when a message is received, passing message data as argument
8787- ` onError ` {Function} Callback function invoked when an error is received, passing error object as argument
@@ -100,8 +100,8 @@ const MyComponent = () => (
100100- ` postMessage ` {Function} sends a message to the Web Worker
101101
102102> 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 .
105105
106106## Examples
107107
You can’t perform that action at this time.
0 commit comments