Neologistic Paraphasic Mumbling
Wondering what’s next for npm?Check out our public roadmap! »

@yunfly/chunk-promiseTypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

chunk-promise Build Status Coverage Status

这个模块将Promise分成多个块,并依次执行它

This module breaks the Promise into chunks and executes it in turn

Install

  npm i @yunfly/chunk-promise

USE

  import { chunkPromise } from '../lib/index';
 
  var promises = [
      () => Promise.resolve('a'),
      () => Promise.resolve('b'),
      () => Promise.resolve('c'),
      () => Promise.resolve('d'),
      () => Promise.resolve('e'),
      () => Promise.resolve('f'),
      () => Promise.resolve('g'),
    ]
 
    chunkPromise(promises, 2)
      .then(results => {
        // ["a", "b", "c", "d", "e", "f", "g"]
        // do something
      });

Install

npm i @yunfly/chunk-promise

DownloadsWeekly Downloads

16

Version

1.0.8

License

MIT

Unpacked Size

5.47 kB

Total Files

6

Last publish

Collaborators

  • avatar