GoogleChromeLabs / tasklets

177 stars 17 forks source link

Polyfill: don't use classes unnecessarily #17

Closed domenic closed 7 years ago

domenic commented 7 years ago

These seem like a sign that ExportedObject is not a real class, with data and behavior, that you create useful instances of which you keep around and manipulate as objects.

Probably instead you want a function, not a class, which takes an (obj, port) pair and sets its onmessage appropriately.