Thursday, 30 October 2014
Javascript and promises
I wrote a little tutorial a small while back on using promises within Javascript as this seems to be a point of confusion for some, especially those new to promises. The tutorial is not meant to be ultimately comprehensive, but hopefully it should at least be useful -- and it made me polish up a promises library of my own for learning and display purposes.
You can get all the code here: https://github.com/fluffynuts/js-promises-tutorial and indeed that repository is what I'm using for the iframe source below, using RawGit. Mainly because it relies on a bunch of Javascript and JSON files to work but also because I'm way too lazy to maintain multiple versions of this and this tutorial may be revisited for a little spit 'n polish on occasion. (EDIT: this entry was updated to include example usage of the ES6 native Promise prototype).
Subscribe to:
Posts (Atom)
What's new in PeanutButter?
Retrieving the post... Please hold. If the post doesn't load properly, you can check it out here: https://github.com/fluffynuts/blog/...
-
So here's a neat little thing that I learned tonight: how to run a script after a specific package is installed or updated. Why? Bec...
-
There was a time when INI files ruled the world of configuration. Since then, we've been told on numerous occasions by many people that ...
-
Introducing... Peanut Butter! I've been writing code for about 15 years now. It's not really that long, considering the amount of...