Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function each(ary, fn) {
- ary = Array.from(ary);
- return (function next() {
- if (ary.length) {
- return Promise.resolve(fn(ary.shift())).then(next);
- }
- })();
- }
- each(category.channels, channel => {
- return list(channel).then(items => {
- return each(items, item => {
- return process(item, category.id);
- });
- });
- });
Add Comment
Please, Sign In to add comment