All Projects → vaneenige → uot

vaneenige / uot

Licence: MIT license
🦁 A tiny setTimeout alternative with progress.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to uot

Scrollprogress
🛸 Light weight library to observe the viewport scroll position
Stars: ✭ 148 (+244.19%)
Mutual labels:  observer, progress
Uos
🐭 A tiny 250b scroll listener with progress.
Stars: ✭ 349 (+711.63%)
Mutual labels:  observer, progress
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: ✭ 15 (-65.12%)
Mutual labels:  timeout
mr-Observer
An observer is a wrapper over JSON data, that provides an interface to know when data is changed, with a focus on performance and memory efficiency.
Stars: ✭ 22 (-48.84%)
Mutual labels:  observer
life-progress
🚼->🚶->👻
Stars: ✭ 20 (-53.49%)
Mutual labels:  progress
spinnies
Node.js module to create and manage multiple spinners in command-line interface programs
Stars: ✭ 111 (+158.14%)
Mutual labels:  progress
tox-progress
This JavaScript library was made to easily create animated radial progress bars.
Stars: ✭ 13 (-69.77%)
Mutual labels:  progress
notion-tqdm
Progress Bar displayed in Notion like tqdm for Python
Stars: ✭ 64 (+48.84%)
Mutual labels:  progress
CustomProgress
自定义水平带百分比数字的进度条以及自定义圆形带百分比数字的进度条
Stars: ✭ 58 (+34.88%)
Mutual labels:  progress
SwiftObserver
Elegant Reactive Primitives for Clean Swift Architecture #NoRx
Stars: ✭ 14 (-67.44%)
Mutual labels:  observer
go-observer
Go package for simplifying channel-based broadcasting of events from multiple publishers to multiple observers
Stars: ✭ 66 (+53.49%)
Mutual labels:  observer
angular-progress-http
[DEPRECATED] Use @angular/common/http instead
Stars: ✭ 43 (+0%)
Mutual labels:  progress
deep-state-observer
State library for high performance applications.
Stars: ✭ 25 (-41.86%)
Mutual labels:  observer
arc-progress
🐳 Arc circular animation progress bar drawn by canvas, you can used in the react component, or no dependence.
Stars: ✭ 42 (-2.33%)
Mutual labels:  progress
GaugeProgressView
Tired of boring Android progress views? This one is amazing!
Stars: ✭ 17 (-60.47%)
Mutual labels:  progress
bioinf-commons
Bioinformatics library in Kotlin
Stars: ✭ 21 (-51.16%)
Mutual labels:  progress
node-reactive-postgres
Reactive queries for PostgreSQL
Stars: ✭ 28 (-34.88%)
Mutual labels:  observer
react-sweet-progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 250 (+481.4%)
Mutual labels:  progress
patterns
Good practices to create code in Java, open to other languages. ⚡
Stars: ✭ 14 (-67.44%)
Mutual labels:  observer
ProgressView
Custom view scrollbar
Stars: ✭ 28 (-34.88%)
Mutual labels:  progress

Update Over Time (uot)

npm version gzip size license dependencies

Update Over Time (uot) is a tiny library to provide the easiest way for updating values over time. Provide a callback and a duration you're ready to go!

This utility can be useful for CSS animations, DOM changes, WebGL transitions or anything that can be updated based on a progress value.

It's basically a setTimeout (or setInterval) with progress.

Features:

  • Small in size, no dependencies
  • Based on requestAnimationFrame
  • Optimized for multiple instances

Install

$ npm install --save uot

Usage

Import the library:

import updateOverTime from 'uot';

Provide a callback and a duration:

updateOverTime((progress) => {
  // Progress value: 0 ... 1
  if (progress === 1) {
    // Handle complete
  }
}, 2000);

As a third parameter an optional repeat count can be provided.

Use the progress value to update the DOM (or anything):

updateOverTime((progress) => {
  // Add easing to the progress value
  progress = easeInOutQuad(progress);
  // Output the progress value to the DOM
  document.body.textContent = progress.toFixed(2);
}, 4000);

At any given time only a single requestAnimationFrame will be called.

License

MIT © Colin van Eenige

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].