Skip to content

Instantly share code, notes, and snippets.

@jfet97
Last active December 7, 2018 13:32
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 jfet97/e6eb17dd9af13526a4f3b8be017c267f to your computer and use it in GitHub Desktop.
Save jfet97/e6eb17dd9af13526a4f3b8be017c267f to your computer and use it in GitHub Desktop.
ex3.js
const { asyncGeneratorsFactory } = require('agh');
// filter function
const onlyOddPlease = function (n) {
if (n % 2) return n;
}
// transform function
const plusOne = function (n) {
return n + 1;
}
const onlyOddPleaseGen = asyncGeneratorsFactory(onlyOddPlease);
const plusOneGen = asyncGeneratorsFactory(plusOne);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment