Last active
January 16, 2018 10:51
-
-
Save hmpmarketing/796a6afcf7181d0363d48fd3c02d6922 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function has(id) { | |
| const val = await cache.has(`actioncookiecap-${id}`); | |
| return { val, id }; | |
| } | |
| actionFilter.filterVisited = async function (actions) { | |
| const results = await Promise.all(actions.map(has)); | |
| console.log(results) //Returns [ { val: false, id: 39708 }, { val: false, id: 39709 } ] | |
| return results.filter(v => v.val).map(v => v.id); | |
| } | |
| actionFilter.filterVisited(actions).then(function(a){ | |
| console.log(a) //return [] ?? | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment