Skip to content

mixmix/pull-tick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pull-tick

This is a modification of pull-infinite.

tick( generete, period )

where:

  • generate is some function() that generates data
  • period is the period with which this happens (in ms)

Tick returns a pull-source.

var pull = require('pull-stream')
var tick = require('pull-tick')

pull(
  tick( () => 'tick', 1000 ),
  pull.take(20),
  pull.drain( 
    (data) => console.log(Date.now(), `received ${data}`),
    () => console.log('thank god the ticking has stopped')
  )
)

Note the useful pull.take, which allows us to take only the first n of the possible infinite ticks.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published