mtkopone/smoax — pull request #1 by lauripiispanen (2013-03-06 10:15:18+00:00)
Title: Precise control over ajax responses with deferreds

This pull request adds the `.registerDeferred()` function, which gives explicit control over when ajax calls return (instead of relying on timeouts). Example use case could be to ensure that FRP-style switchLatest() calls or pending long-running ajax calls are aborted correctly when later calls are being made. I use this to check that my Backbone collection "loading" indicators work properly:

```javascript
var firstCall = smoax.registerDeferred();
expect(loading).to.equal(false);
coll.fetch();
expect(loading).to.equal(true);
firstCall.resolve({});
expect(loading).to.equal(false);

// ...and so on but with aborts etc. curveballs
```