Skip to content

Instantly share code, notes, and snippets.

@PhoSor
Created September 28, 2013 16:04
Show Gist options
  • Save PhoSor/6743564 to your computer and use it in GitHub Desktop.
Save PhoSor/6743564 to your computer and use it in GitHub Desktop.
var Chain = require('chain');
var mockMakeAjaxRequestAndReturnCallback = require('mockMakeAjaxRequestAndReturnCallback');
var mockRenderData = require('mockRenderData');
var generateLink = function (domain) {
return 'http://' + domain + '/resource';
};
var renderData = function (data) {
mockRenderData(data);
};
Chain().
defer(function(n, done) {
mockMakeAjaxRequestAndReturnCallback('/domain', done);
}).
then(generateLink).
defer(mockMakeAjaxRequestAndReturnCallback).
then(renderData).
end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment