{"id":105,"date":"2011-05-23T18:52:25","date_gmt":"2011-05-23T22:52:25","guid":{"rendered":"http:\/\/www.joshmatthews.net\/blog\/?p=105"},"modified":"2011-05-23T18:52:25","modified_gmt":"2011-05-23T22:52:25","slug":"js-runnables-now-with-less-boilerplate","status":"publish","type":"post","link":"https:\/\/www.joshmatthews.net\/blog\/2011\/05\/js-runnables-now-with-less-boilerplate\/","title":{"rendered":"JS runnables: now with less boilerplate"},"content":{"rendered":"<p>Actually, this little trick has been possible for at least a year and a half since I fixed the enhancement request, but I don&#8217;t believe it&#8217;s common knowledge.  When writing something like<br \/>\n<code>someEventTarget.dispatch({ run: function() { ... })<\/code>, you can simply use <code>someEventTarget.dispatch(function() { ... })<\/code> and skip the object goop. It looks cleaner to my eyes, so I thought I&#8217;d try to get the message out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Actually, this little trick has been possible for at least a year and a half since I fixed the enhancement request, but I don&#8217;t believe it&#8217;s common knowledge. When writing something like someEventTarget.dispatch({ run: function() { &#8230; }), you can &hellip; <a href=\"https:\/\/www.joshmatthews.net\/blog\/2011\/05\/js-runnables-now-with-less-boilerplate\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-mozilla"],"_links":{"self":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/comments?post=105"}],"version-history":[{"count":1,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":106,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts\/105\/revisions\/106"}],"wp:attachment":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/tags?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}