(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Writing JS for everything is great and all, but I don't want to see JS | |
| // inline in my Jade templates. Thankfully, there are ways of abstrating it | |
| // into mixins! | |
| // Want some Rails-like helpers? | |
| mixin link_to(name, href) | |
| - href = href || "#" | |
| a(href="#{href}")= name | |
| // How about a single editing point for a class name? |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |