threads.js icon indicating copy to clipboard operation
threads.js copied to clipboard

Document "do not pass functions or class instances to threads"

Open andywer opened this issue 6 years ago • 1 comments

Follow-up of #140.

Regarding the class instances: You can pass them, of course, but you will only receive the instance properties as a plain object. The worker cannot know which prototype that instance used to have before serialization.

andywer avatar Jul 31 '19 05:07 andywer

Related feature: Custom Serializers #207

andywer avatar Feb 05 '20 16:02 andywer