Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

callbag-timer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callbag-timer

👜 Callbag source that after given duration, emit numbers in sequence every specified duration.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

callbag-timer

Observable source that after given duration, emit numbers in sequence every specified duration.

Examples

With single argument

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

pipe(
  timer(1000),
  forEach(value => {
    // will log 0
    console.log(value)
  }),
)

With both parameters used

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

pipe(
  timer(1000, 2000),
  forEach(value => {
    // will log 0 1 2 3 4 ...
    console.log(value)
  }),
)

With Date

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

const date = new Date(Date.now() + 10000)

pipe(
  timer(date, 2000),
  forEach(value => {
    // will log 0 1 2 3 4 ...
    console.log(value)
  }),
)

Used as notifier source

import dropUntil from 'callbag-drop-until'
import forEach from 'callbag-for-each'
import pipe from 'callbag-pipe'
import timer from 'callbag-timer'

pipe(
  interval(1000),
  dropUntil(timer(6000)),
  forEach(value => {
    // will log 5 6 7 8 ...
    console.log(value)
  }),
)

Keywords

FAQs

Package last updated on 26 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc