Skip to content
/ ora-p Public

🧤 Promise based currying ora function

Notifications You must be signed in to change notification settings

deptno/ora-p

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ora-p

Promise based currying ora function

ora-p

Install

npm install ora-p

Usage

ora('text', promise)

with currying

import ora from 'ora-p'

// promise delay helper
const delayO = time => new Promise(r => setTimeout(r, time))
const delayX = time => new Promise((_, r) => setTimeout(r, time))

// currying
const load = ora('loading')
const search = ora('searching')

async function main() {
  await load(delayO(1000))
  await search(delayO(1000))
  await load(delayO(1000))
  await search(delayX(1000))
}
main() // screenshot

License

MIT

Releases

No releases published

Packages

No packages published