Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
Created May 31, 2017 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattpodwysocki/575cf71bf465faca11d90a0b92fbc7a0 to your computer and use it in GitHub Desktop.
Save mattpodwysocki/575cf71bf465faca11d90a0b92fbc7a0 to your computer and use it in GitHub Desktop.
'use strict';
import { mapAsync } from 'ix/async/mapasync';
import { filterAsync } from 'ix/async/filterasync';
const source = filterAsync(
mapAsync([1, 2, 3, 4, 5], async x => x * x),
async x => x % 3 === 0
);
for await (let item of source) {
console.log(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment