-
-
Save andrewho83/45ae6e858f11467a3813 to your computer and use it in GitHub Desktop.
Bluebid Promises
This file contains 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 streamPromise = FeedManager.getLiveStreams(requestingUserId, options); | |
var videos = streamPromise.then(function(response) { | |
nextPage = response.nextPage; | |
return response.streams | |
}).map(function(stream) { | |
return DataConverter.getVideoFromStreamObject(stream); | |
}).map(function(video) { | |
return APIConverter.getExternalVideoObject(video); | |
}).then(function(videos) { | |
res.json({ | |
videos: videos, | |
nextPage: nextPage | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment