All Projects → dntzhang → raf-interval

dntzhang / raf-interval

Licence: other
setRafInterval and clearRafInterval with requestAnimationFrame - 40行代码实现的高性能动画定时器

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to raf-interval

raf-perf
RAF loop with an adaptive fps and performance ratio calculated from either a sample count or a sample duration. Typically used when doing intensive graphics computation in canvas.
Stars: ✭ 40 (-48.05%)
Mutual labels:  requestanimationframe, ticker, tick
audio-context-timers
A replacement for setInterval() and setTimeout() which works in unfocused windows.
Stars: ✭ 12 (-84.42%)
Mutual labels:  setinterval, clearinterval
cryptocoins-desklet-cinnamon
Cryptocurrency Ticker (Desklet) for Cinnamon Desktop that displays the current price for thousands of cryptocurrencies, and their daily percent changes.
Stars: ✭ 18 (-76.62%)
Mutual labels:  ticker
crypto-cli
The best cryptocurrency price CLI written in one line 💰
Stars: ✭ 18 (-76.62%)
Mutual labels:  ticker
TerminalStocks
Pure terminal stock ticker for Windows.
Stars: ✭ 88 (+14.29%)
Mutual labels:  ticker
anim-event
Event Manager for Animation
Stars: ✭ 25 (-67.53%)
Mutual labels:  requestanimationframe
coinget
**deprecated API (no longer works)** The fastest cli 💻 price checker for cryptocurrencies📈
Stars: ✭ 27 (-64.94%)
Mutual labels:  ticker
CryptoTickerBot
A .NET Core program to fetch ticker data from various crypto exchange websites.
Stars: ✭ 30 (-61.04%)
Mutual labels:  ticker
bitprice-ios
iOS app for display and monitor the current Bitcoint (BTC) rate.
Stars: ✭ 38 (-50.65%)
Mutual labels:  ticker
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: ✭ 15 (-80.52%)
Mutual labels:  setinterval
i3blocks-crypto
💵 View your favorite coins' ticker prices with i3blocks.
Stars: ✭ 30 (-61.04%)
Mutual labels:  ticker
dynamic-marquee
A small library for creating marquees.
Stars: ✭ 64 (-16.88%)
Mutual labels:  ticker
timer
Timing Events tied to @gamestdio/clock
Stars: ✭ 20 (-74.03%)
Mutual labels:  setinterval
cryptocurrency-ticker
Get the current ticker information for cryptocurrencies
Stars: ✭ 12 (-84.42%)
Mutual labels:  ticker
raf-pool
requestAnimationFrame pool to avoid busyness on the thread
Stars: ✭ 16 (-79.22%)
Mutual labels:  requestanimationframe
btc-ticker-esp8266
realtime bitcoin price on 7 segment display with arduino on esp8266
Stars: ✭ 18 (-76.62%)
Mutual labels:  ticker
animate
👾 Create and manage animation functions with AnimationFrame API.
Stars: ✭ 11 (-85.71%)
Mutual labels:  requestanimationframe
react-animation-frame
A React higher-order component that invokes a callback in a wrapped component via requestAnimationFrame
Stars: ✭ 47 (-38.96%)
Mutual labels:  requestanimationframe
kdb-tick
Latest source files for kdb+tick
Stars: ✭ 73 (-5.19%)
Mutual labels:  tick
uot
🦁 A tiny setTimeout alternative with progress.
Stars: ✭ 43 (-44.16%)
Mutual labels:  requestanimationframe

raf-interval

setRafInterval and clearRafInterval with requestAnimationFrame.

Usage

before raf-interval:

var i = 0
var interval = setInterval(function() {
    console.log(i++)
    if (i > 6) {
        clearInterval(interval)
    }
},1000)

after raf-interval:

var i = 0
var rafInterval = setRafInterval(function() {
    console.log(i++)
    if (i > 6) {
        clearRafInterval(rafInterval)
    }
},1000)

Features

  • Support setRafInterval and clearRafInterval like setInterval and clearInterval
  • Automatically stops when the user switches to a different tab
  • High performance animation with simple API
  • Automatic stop the loop when it is not needed

Install

$ npm install raf-interval

or get it by CDN:

License

This content is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].