Last active
April 10, 2019 18:17
-
-
Save gbabiars/46412f7f5148a9a05f2f0e2b01c258ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In JSX, callback can get passed directly as part of api | |
<MyComponent onSomething={handler} /> | |
// With events, there is a disconnect between the event publisher and the consumer of the event | |
<my-component></my-component> | |
// Some parent, but could be multiple, hard to follow | |
let myComponent = this.querySelector('my-component'); | |
myComponent.addEventListener('something', handler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment