All Projects → rwu823 → Stop.js

rwu823 / Stop.js

🐦 The Promise base `setTimeout`, release your callback

Programming Languages

javascript
184084 projects - #8 most used programming language
js
455 projects

Labels

Projects that are alternatives of or similar to Stop.js

Vue Promised
💝 Composable Promises & Promises as components
Stars: ✭ 1,325 (+1004.17%)
Mutual labels:  promise
Simple Fs
Handles files on indexeddb like you would do in node.js (promise)
Stars: ✭ 111 (-7.5%)
Mutual labels:  promise
Elemental2
Type checked access to browser APIs for Java code.
Stars: ✭ 115 (-4.17%)
Mutual labels:  promise
Dynamodb Oop
Speak fluent DynamoDB, write code with fashion, I Promise() 😃
Stars: ✭ 104 (-13.33%)
Mutual labels:  promise
Ssh2 Promise
ssh with promise/async await and typescript support
Stars: ✭ 110 (-8.33%)
Mutual labels:  promise
Vue2 Element
基于vue2 + vue-router2 + element-ui + vuex2 + fetch + webpack2 企业级后台管理系统最佳实践
Stars: ✭ 112 (-6.67%)
Mutual labels:  promise
Mfetch
mfetch will provide you with a strong ability to request resource management
Stars: ✭ 90 (-25%)
Mutual labels:  promise
Zousan
A Lightning Fast, Yet Very Small Promise A+ Compliant Implementation
Stars: ✭ 117 (-2.5%)
Mutual labels:  promise
Ts3 Nodejs Library
TeamSpeak 3 Server Query Library supports SSH and RAW Query
Stars: ✭ 110 (-8.33%)
Mutual labels:  promise
Jdeferred
Java Deferred/Promise library similar to JQuery.
Stars: ✭ 1,483 (+1135.83%)
Mutual labels:  promise
P State
Inspect the state of a promise
Stars: ✭ 108 (-10%)
Mutual labels:  promise
Sfdc Lax
The service Lightning Component to write a clear asynchronous JavaScript code
Stars: ✭ 109 (-9.17%)
Mutual labels:  promise
Blizzard.js
A promise-based Node.JS library for the Blizzard Battle.net Community Platform API
Stars: ✭ 113 (-5.83%)
Mutual labels:  promise
Es6 Promise Polyfill
ES6 Promise polyfill
Stars: ✭ 99 (-17.5%)
Mutual labels:  promise
Postmate
📭 A powerful, simple, promise-based postMessage library.
Stars: ✭ 1,638 (+1265%)
Mutual labels:  promise
Taskorama
⚙ A Task/Future data type for JavaScript
Stars: ✭ 90 (-25%)
Mutual labels:  promise
P Queue
Promise queue with concurrency control
Stars: ✭ 1,863 (+1452.5%)
Mutual labels:  promise
Bach
Compose your async functions with elegance.
Stars: ✭ 117 (-2.5%)
Mutual labels:  promise
Article
前端相关、CSS、JavaScript、工具、解决方案…相关文章
Stars: ✭ 116 (-3.33%)
Mutual labels:  promise
Promise Queue Plus
Promise-based queue. Support timeout, retry and so on.
Stars: ✭ 113 (-5.83%)
Mutual labels:  promise

version Build Status codecov

Stop.js

The Promise based setTimeout and setImmediate for the modern browsers and node.

‼️Important

stop.js change to use milliseconds as default unit. #1

Browser Supported

Why

In ES7 async/await is awesome, but that only supported with Promise.

Installation

npm i --save stop.js

Includes babel-polyfill before use async and await

Before

console.log(1)
setTimeout(()=>{
  console.log(2) // slow than 5 secs
}, 5000)

After

import stop from 'stop.js'

async function asyncFunc() {
  console.log(1)
  await stop(5000)
  console.log(2) // slow than 5 secs
}

asyncFunc()

setImmediate

0 is default, it'll call the YuzuJS/setImmediate library

console.log(1)
setImmediate(()=>{
  console.log(2)
})

same as

console.log(1)
await stop(0)
console.log(2)

or pass nothing

console.log(1)
await stop()
console.log(2)

API

stop([ms = 0])

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