Skip to content

👜 Callbag operator that attaches a timestamp to each emitted value.

Notifications You must be signed in to change notification settings

Andarist/callbag-timestamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

callbag-timestamp

Callbag operator that attaches a timestamp to each emitted value.

Example

import forEach from 'callbag-for-each'
import pipe from 'callbag-pipe'
import take from 'callbag-take'
import timer from 'callbag-timer'
import timestamp from 'callbag-timestamp'

pipe(
  timer(0, 1000),
  timestamp,
  take(5),
  forEach(timestamped => {
    // will log:
    // [1378690776351, 0]
    // [1378690777313, 1]
    // [1378690778316, 2]
    // [1378690779317, 3]
    // [1378690780319, 4]
    console.log(timestamped)
  }),
)

About

👜 Callbag operator that attaches a timestamp to each emitted value.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published