TL;DR: Subclass Event instead of using CustomEvent 😎
justinfagnani.com/2025/06/25/s...
TL;DR: Subclass Event instead of using CustomEvent 😎
justinfagnani.com/2025/06/25/s...
CustomEvent is *criminally* under-utilized
developer.mozilla.org/en-US/docs/W...
CustomEvent is *criminally* under-utilized
developer.mozilla.org/en-US/docs/W...
Use 𝙲𝚞𝚜𝚝𝚘𝚖𝙴𝚟𝚎𝚗𝚝 for custom event dispatching and handling in the DOM.
Use 𝙲𝚞𝚜𝚝𝚘𝚖𝙴𝚟𝚎𝚗𝚝 for custom event dispatching and handling in the DOM.
Shoelace prefers custom events: CustomEvent('sl-open')
Other libs typically emits normal evs: Event('open')
Shoelace prefers custom events: CustomEvent('sl-open')
Other libs typically emits normal evs: Event('open')
#Pride365 #MoreThanAGame #LGBT #LGBTQIA+ #Autism #AutismCommunity #AutismServer #mc #minecraft #minecraftEvent #minecraftResourcePack #CustomEvent #showcase
www.youtube.com/shorts/cZBkq...
#Pride365 #MoreThanAGame #LGBT #LGBTQIA+ #Autism #AutismCommunity #AutismServer #mc #minecraft #minecraftEvent #minecraftResourcePack #CustomEvent #showcase
www.youtube.com/shorts/cZBkq...
#Pride #Minecraft #MinecraftEvent #mc #CaptureTheFlag #PrideCaptureTheFlag #CustomEvent
#Pride #Minecraft #MinecraftEvent #mc #CaptureTheFlag #PrideCaptureTheFlag #CustomEvent
What is the correct way to emit an event from a child component in Vue 3 Composition API?
A) emitEvent('customEvent')
B) this.emit('customEvent')
C) emit('customEvent')
D) trigger('customEvent')
#TechQuiz #AI #Developer #VueJS
What is the correct way to emit an event from a child component in Vue 3 Composition API?
A) emitEvent('customEvent')
B) this.emit('customEvent')
C) emit('customEvent')
D) trigger('customEvent')
#TechQuiz #AI #Developer #VueJS
There is a much better way to handle custom events.
#JavaScript #TypeScript #WebDev
1/5
There is a much better way to handle custom events.
#JavaScript #TypeScript #WebDev
1/5
github.com/umbraco/Umbr...
github.com/umbraco/Umbr...
const click = () => {
if (editor) {
const script = base + editor.getValue() + fim
const saida = eval(script) // <<=======
window.dispatchEvent(new CustomEvent("movimentos", { detail : {movimentos: saida }, bubbles: true}))
}
}
const click = () => {
if (editor) {
const script = base + editor.getValue() + fim
const saida = eval(script) // <<=======
window.dispatchEvent(new CustomEvent("movimentos", { detail : {movimentos: saida }, bubbles: true}))
}
}
1. I think CustomEvent tends to be the most common and is still a viable option
2. Teams may want to switch to subclassing, but may not be in a position to introduce breaking changes, but can update the types
1. I think CustomEvent tends to be the most common and is still a viable option
2. Teams may want to switch to subclassing, but may not be in a position to introduce breaking changes, but can update the types
#Msdyn365bc #CustomEvent #BCALHelp #ALHelp #BusinessCentral #IntegrationEvent #BusinessEvent #ALCode #IsHandled
#Msdyn365bc #CustomEvent #BCALHelp #ALHelp #BusinessCentral #IntegrationEvent #BusinessEvent #ALCode #IsHandled
なので再レンダリングの代わりに親がupdateしたことを伝えるCustomEventをdispatchするようにしたらいいのではないかと思った
具体的にはこんな感じ
メリットとして全ての処理が1つのイベントの中に集約され、不要な再レンダリングが起きないようになる
なので再レンダリングの代わりに親がupdateしたことを伝えるCustomEventをdispatchするようにしたらいいのではないかと思った
具体的にはこんな感じ
メリットとして全ての処理が1つのイベントの中に集約され、不要な再レンダリングが起きないようになる
For years, developers used CustomEvent to pass data.
You must always wrap your data inside a detail property.
You cannot access your values directly.
It is also hard to type properly in TypeScript.
2/5
For years, developers used CustomEvent to pass data.
You must always wrap your data inside a detail property.
You cannot access your values directly.
It is also hard to type properly in TypeScript.
2/5
It makes your codebase easier to maintain.
Do you still use CustomEvent?
Or have you already switched to extending Event?
5/5
It makes your codebase easier to maintain.
Do you still use CustomEvent?
Or have you already switched to extending Event?
5/5
developer.mozilla.org/en-US/docs/W...
developer.mozilla.org/en-US/docs/W...
CustomEventで引数が使えるようになり
CyanTriggerが壊れた
CustomEventで引数が使えるようになり
CyanTriggerが壊れた