it('slices stream to length if one arg provided', function (done) { var things = [1,2,3,4,'7',{},6]; var thingsStream = new ReadableArray(things); var slicedThingsStream = thingsStream.pipe(slice(3)); var slicedThings = sliceArray.call(things, 3); assertStreams(slicedThingsStream, slicedThings, done); });
it('slices stream to start, stop if two args provided', function (done) { var things = [1,2,3,4,'7',{},6]; var thingsStream = new ReadableArray(things); var slicedThingsStream = thingsStream.pipe(slice(3,5)); var slicedThings = sliceArray.call(things, 3, 5); assertStreams(slicedThingsStream, slicedThings, done); });
}); // Connect to a Personalized Stream on login function onLogin(user) { // connect to sample stream, which will consistently pump activities sampleStream.connect(user.get('token'), 'sample'); } transform(sampleStream) .forEach(function (data) { console.log('sample stream data', data) }) // Get a 100 activities of all sorts var activities = cycle(activityMocks.toArray()) .pipe(slice(100)); // // Get just the subset of Livefyre ones // var livefyreActivites = activities // .pipe(transform.filter(function (a) { // var actorId = a && a.actor && a.actor.id; // return actorId && /livefyre/.test(actorId); // })); // Livefyre activites go in one feed // livefyreActivities // .pipe(CustomActivityRenderer()) // .forEach(function (el) { // collectionFeed.appendChild(el); // });