@feizheng/next-loop-execute

1.0.4 • Public • Published

next-loop-execute

Loop execute for next.

version license size download

installation

npm install -S @feizheng/next-loop-execute

usage

import '@feizheng/next-loop-execute';

const fetchApi = function ({ count }) {
  return fetch('https://api.github.com/users/afeiship').then(res=>res.json());
}

// loop 3 times:
nx.loopExecute({
  callback: fetchApi,
  done: function (res) {
    console.log('res.data:', res.data);
    return res.count === 3;
  }
}).then(res=>{
  console.log('loop DONE!', res);
});

license

Code released under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @feizheng/next-loop-execute

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

5.55 kB

Total Files

5

Last publish

Collaborators

  • afeiship