0.1.2 • Published 6 years ago

ora-p v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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