Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```js
- let producer = () => new Promise((resolve, reject) => {
- let count = 0;
- setInterval(() => {
- res(count++);
- }, 1000);
- });
- let consumer = data => { console.log(data); };
- producer().then(consumer) // 0
Add Comment
Please, Sign In to add comment