1.0.4 • Published 4 years ago

@feizheng/next-loop-execute v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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.

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago