ora-p
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i ora-p

Weekly Downloads

4

Version

0.1.2

License

MIT

Unpacked Size

6.13 kB

Total Files

5

Last publish

Collaborators

  • deptno