Last active
August 29, 2015 14:21
-
-
Save pelonpelon/45bad068bf041260f8bf to your computer and use it in GitHub Desktop.
Javascript snippets
This file contains 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
somePromise().then(function () { | |
return anotherPromise(); | |
}).then(function () { | |
return yetAnotherPromise(); | |
}).catch(console.log.bind(console)); // <-- this is badass |
This file contains 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
function spy(m, plugin) { | |
function res() { | |
var vdom = m.apply(null, arguments) | |
plugin(vdom); | |
return vdom; | |
} | |
for (var k in m) if (m.hasOwnProperty(k)) res[k] = m[k]; | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment