Nicely Pointed Mandibles

    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

    Keywords

    Install

    npm i ora-p

    DownloadsWeekly Downloads

    11

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    6.13 kB

    Total Files

    5

    Last publish

    Collaborators

    • deptno