{"id":7809,"date":"2025-11-19T19:03:05","date_gmt":"2025-11-20T00:03:05","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=7809"},"modified":"2025-11-19T19:03:06","modified_gmt":"2025-11-20T00:03:06","slug":"stop-using-customevent","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/stop-using-customevent\/","title":{"rendered":"Stop Using CustomEvent"},"content":{"rendered":"\n<p>A satisfying little rant from Justin Fagnani: <a href=\"https:\/\/justinfagnani.com\/2025\/06\/25\/stop-using-custom-event\/\">Stop Using <code>CustomEvent<\/code><\/a>.<\/p>\n\n\n\n<p>One point is that you&#8217;re forcing the consumer of the event to know that it&#8217;s custom and you have to get data out of the <code>details<\/code> property. Instead, you can subclass <code>Event<\/code> with new properties and the consumer of <em>that<\/em> event can pull that data right off the event itself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A satisfying little rant from Justin Fagnani: Stop Using CustomEvent. One point is that you&#8217;re forcing the consumer of the event to know that it&#8217;s custom and you have to get data out of the details property. Instead, you can subclass Event with new properties and the consumer of that event can pull that data [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7811,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[424,425,3],"class_list":["post-7809","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-customevent","tag-extends","tag-javascript"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-19-at-4.02.39-PM.png?fit=1234%2C734&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/7809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=7809"}],"version-history":[{"count":1,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/7809\/revisions"}],"predecessor-version":[{"id":7810,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/7809\/revisions\/7810"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/7811"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=7809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=7809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=7809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}