Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pull(
  2.   ssb.createFeedStream(),
  3.   pull.reduce(function (acc, item) {
  4.     if (item.message) {
  5.       var vote = parseInt(item.message.toString(), 10);
  6.       if (!isNaN(vote)) {
  7.         console.log('vote: ', vote);
  8.         return acc + vote;
  9.       } else {
  10.         return 0;
  11.       }
  12.     }
  13.   }, 0, function (err, result) {
  14.     console.log('result: ', result);
  15.   })
  16. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement