Skip to content

Instantly share code, notes, and snippets.

@antenando
Last active August 1, 2016 01:12
Show Gist options
  • Save antenando/cf583ca4fd0beeaebf28f92c000b2b41 to your computer and use it in GitHub Desktop.
Save antenando/cf583ca4fd0beeaebf28f92c000b2b41 to your computer and use it in GitHub Desktop.
var piper = function(data) {
return {
data : data,
pipe : function(vai) {
data = vai(data);
console.log(data);
return this;
}
}
}
// async buddy
var res = piper({}).pipe(function(data) {
data.name = 'ilya';
return data;
}).pipe(function(data){
data.lastName = 'Russian';
return data;
});
console.log(res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment