New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@byzanteam/timer

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byzanteam/timer

Timer for Carbonium

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by40%
Maintainers
5
Weekly downloads
 
Created
Source

timer

Timer support for Carbonium.

Installation

$ npm install @byzanteam/timer

Usage

Create Timer

import { createTimer } from '@byzanteam/timer'

const timer = createTimer()

// Create timer with given defaults.
const timer = createTimer({ delay: 0, duration: 1e3, easingFunction: 'easeInOut' })

Subscribe

timer.subscribe() 向 timer 中添加任务,返回退订函数。调用退订函数会从任务队列中移除相关的所有任务。该函数一共有两种调用形式,如下所示。

const handler = (progress: number) => {
  // Do something with the progress...
}

// 单个任务配置对象。
timer.subscribe({ duration: 2e3, handler })

// 多个任务配置对象数组。
const unsubscribe = timer.subscribe([
  {
    delay: 250,
    handler,
  },
  {
    duration: 250,
    handler,
  }
])

// 调用 unsubscribe 函数会移除订阅的所有任务。
unsubscribe()

Keywords

FAQs

Package last updated on 13 May 2020

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