rwu823 / Stop.js
🐦 The Promise base `setTimeout`, release your callback
Stars: ✭ 120
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
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
Postmate
📭 A powerful, simple, promise-based postMessage library.
Stars: ✭ 1,638 (+1265%)
Mutual labels: promise
Promise Queue Plus
Promise-based queue. Support timeout, retry and so on.
Stars: ✭ 113 (-5.83%)
Mutual labels: promise
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].