proposal-emitter icon indicating copy to clipboard operation
proposal-emitter copied to clipboard

Anne Feedback

Open pemrouz opened this issue 5 years ago • 0 comments

Very productive meeting with @annevk and lots of great feedback.

  • [ ] Differences with Observables and better model for events
  • [ ] Events are not just values, they're objects you can interact with. We've tested in some applications, but need to double check all edge cases i.e. stopPropagation, preventDefault, etc. emitter.on('click') currently vends a new Emitter so much less of an issue.
  • [ ] on recognises like "EventTarget-like" objects. This should probably be changed to use a Symbol instead that both browsers and node can implement and language doesn't need to know about it.
  • [ ] Keeping on/once/emit on prototype would probably actually be more convenient for web devs.
  • [ ] Would be great to have this shared based class and operators in the runtime which platform can leverage
  • [ ] Discussed some weakref-y semantics on unsubscription, seems better to keep as-is for now (explicitly removes listener when Emitter resolves or rejects).
  • [ ] Observers! There's a few new platform API which didn't use EventTarget and use this new pattern. Consumers would appreciate being able to use the same utility methods to operate on values. There's no shared base class we can define a relation with, but we can investigate ways of making it easy to upgrade from some observer to an Emitter.
  • [ ] Moving forward: keep a single repo in TC39 for issues rather than fork in WICG, file any issues against relevant spec, e.g. DOM

pemrouz avatar May 23 '19 15:05 pemrouz