HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
tildeio
rsvp.js
JavaScript2012–2013
tildeio / rsvp.js

rsvp.js

A lightweight library that provides tools for organizing asynchronous code

6Distinct people
7Mentions
0Explicit recommenders
3.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A lightweight library that provides tools for organizing asynchronous code

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month7 dated mentions

Observed mentions: 2012-10-16 18:44:12 UTC to 2013-06-28 21:33:06 UTC.

0122012-10-01 00:00:00 UTC to 2012-11-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 commentsOct 20122012-11-01 00:00:00 UTC to 2012-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-12-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-01-01 00:00:00 UTC to 2013-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-02-01 00:00:00 UTC to 2013-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsFeb 20132013-03-01 00:00:00 UTC to 2013-04-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2013-04-01 00:00:00 UTC to 2013-05-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2013-05-01 00:00:00 UTC to 2013-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-06-01 00:00:00 UTC to 2013-07-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 commentsJun 2013

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Oct 20122012-10-01 00:00:00 UTC2012-11-01 00:00:00 UTC211
Nov 20122012-11-01 00:00:00 UTC2012-12-01 00:00:00 UTC000
Dec 20122012-12-01 00:00:00 UTC2013-01-01 00:00:00 UTC000
Jan 20132013-01-01 00:00:00 UTC2013-02-01 00:00:00 UTC000
Feb 20132013-02-01 00:00:00 UTC2013-03-01 00:00:00 UTC000
Mar 20132013-03-01 00:00:00 UTC2013-04-01 00:00:00 UTC202
Apr 20132013-04-01 00:00:00 UTC2013-05-01 00:00:00 UTC101
May 20132013-05-01 00:00:00 UTC2013-06-01 00:00:00 UTC000
Jun 20132013-06-01 00:00:00 UTC2013-07-01 00:00:00 UTC211

What Hacker News says

7 sources
I recently launched my side project I've been building with Meteor js over the past few months. It uses the Soundcloud, Hypemachine, and exfm public APIs to pull in your 'favorite' tracks from each of your usernames provided. It's gives you a unified playlist of all your favorite tracks across the different sites. Audio is being played using the HTML5 Audio API, which currently only works in webkit browsers (Chrome & Safari). Built with: * Meteor JS – http://Meteor.com * Bourbon Sass Mixin Library – http://bourbon.io * Spin.js – http://fgnass.github.io/spin.js/ * Moment.js – http://momentjs.com/ * RSVP.js – https://github.com/tildeio/rsvp.js
In Show HN: myfaves.fm – A flat-ui music player built with Meteor

Show HN: myfaves.fm – A flat-ui music player built with Meteor

I recently launched my side project I've been building with Meteor js over the past few months. It uses the Soundcloud, Hypemachine, and exfm public APIs to pull in your 'favorite' tracks from each of your usernames provided. It's gives you a unified playlist of all your favorite tracks across the different sites. Audio is being played using the HTML5 Audio API, so it currently only works in Chrome and Safari. Built with: * Meteor JS – http://Meteor.com * Bourbon Sass Mixin Library – http://bourbon.io * Spin.js – http://fgnass.github.io/spin.js/ * Moment.js – http://momentjs.com/ * RSVP.js – https://github.com/tildeio/rsvp.js — Reply
12 points · Open discussion
A day later I looked at this again and I'm a little closer to understanding. var listPromise = new Promise(); creates an object that, being a Promise object, has certain methods and internal state, derived from the prototype of Promise. for (var k in listPromise) promises[k] = listPromise[k]; This confused me because I thought "k" was a stand-in for a numeric index, e.g. that it was doing promises[0] = listPromise[0], promises[1] = listPromise[1], etc. That is not what's going on. Rather, "k" refers to attributes and/or methods that objects of the Promise class have by default. It's copying those onto `promises` — the array `promises` itself, not the individual items `promises[i]`, which keep their existing methods and attributes. Coming from a Python background, I think I would have found this more obvious if the variable "
Read the rest
k" were instead called "method" or "attr". If it was `for (var method in listPromise)` it'd be much clearer what's going on, whereas single-letter variables like i, j, and k are, to me, stand-ins for integers. It was also confusing, as you said, that the function uses destructive update rather than treating the input as a value. James did mention this ("augmenting the list with promise methods"), but it's still unexpected, especially when the function is preceded by a Haskell type signature. The reason I only say I'm closer to understanding, and not quite there yet, is I'm not sure what it means to do `new Promise()` or what is being copied over in the above for-loop. I tried James's code with a Promises/A+ implementation, rsvp.js (https://github.com/tildeio/rsvp.js), but it won't let me do `new Promise()` because it works differently: > var promise = new RSVP.Promise(); TypeError: You must pass a resolver function as the sole argument to the promise constructor Per an example in RSVP.js's readme, it's expecting this: var promise = new RSVP.Promise(function(resolve, reject){ // set up a callback that calls either resolve(...) // or reject(...) }); If James is using a specific promises implementation in his code, it appears to be the one he defined in a past blog post (http://blog.jcoglan.com/2011/03/11/promises-are-the-monad-of...), which in turn builds on a module from his JS.Class library (http://jsclass.jcoglan.com/deferrable.html), which I hadn't heard of before. I still think this is a great article, but that code snippet has proven to be quite a puzzle.
In Callbacks are imperative, promises are functional
I asked the same question in Twitter. Turns out James was actually augmenting (i.e. modifying) the array object `promises` to behave as a promise itself. I don't think this was a particularly beautiful way of doing it but it seems to work now that I think of it. Promise libraries, like RSVP.js [1] he referred to, typically implement a way to construct a promise with a depends-on-many relationship, as a function possibly called `all([p1, p2, ...])` (with the same type signature as for `list`), `and(p1, p2, ...)` or something similar. IMO, defining the `list` function that way would've been clearer to the reader and more FP'ish, treating the `promises` argument in as a value and not a mutable object. [1]: https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/all....
In Callbacks are imperative, promises are functional
James does a good job of articulating why promises are such a useful abstraction, especially in JavaScript land. I've been working on a project recently that relies heavily on coordinating many asynchronously-populated values, and I don't even want to think about what the code would look like if we were wrangling callbacks manually. We actually extracted our promises implementation from the work we've been doing, and released it as RSVP.js[1]. While other JavaScript promises libraries are great, we specifically designed RSVP.js to be a lightweight primitive that can be embedded and used by other libraries. Effectively, it implements only what's needed to pass the Promises/A+ spec[2]. For a comparison of RSVP.js with other promises-based JavaScript asynchrony libraries, see this previous discussion on Hacker News[3]. 1: https://github.com/
Read the rest
In Callbacks are imperative, promises are functional

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.