Skip to content

Instantly share code, notes, and snippets.

@PhoSor
Created Sep 28, 2013
Embed
What would you like to do?
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('/domain').
defer(mockMakeAjaxRequestAndReturnCallback).
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