Last active
August 1, 2016 01:12
-
-
Save antenando/cf583ca4fd0beeaebf28f92c000b2b41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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