seqr

    1.0.7 • Public • Published

    Seqr Build Status Coverage Status js-standard-style

    A small ES6 package for execute functions sequentially.

    Install

    Yarn

    yarn add seqr --dev

    NPM

    npm install seqr --save-dev

    UMD file is also available on unpkg:

    <script src="https://unpkg.com/seqr/dist/seqr.min.js"></script>

    You can use the library via window.seqr.

    Usage

    const seqr = require('seqr')()
    const time = () => new Date().getTime()
     
    seqr
      .then(done => {
        setTimeout(() => {
          console.log('Seq 1:', time())
          done()
        }, 1000)
      })
      .then(done => {
        setTimeout(() => {
          console.log('Seq 2:', time())
          done()
        }, 2000)
      })
     
    seqr.then(done => {
      console.log('Seq 3:', time())
      done()
    })
     
    // Seq 1: 1468388509127
    // Seq 2: 1468388511132
    // Seq 3: 1468388511133

    Contributions

    Pull requests and issues are welcome.

    License

    MIT license

    © 2017 José Luis Quintana

    Install

    npm i seqr

    DownloadsWeekly Downloads

    8

    Version

    1.0.7

    License

    MIT

    Last publish

    Collaborators

    • avatar