Check conditions concurrently
A system is said to be concurrent if it can support two or more actions in progress at the same time. A system is said to be parallel if it can support two or more actions executing simultaneously.
The Art of concurrency
We come up with a (curried) function with which we are able to evaluate a variable number of possibly asynchronous functions over a value in a concurrent way.
const checkConditions = (...predicates) => (value) => Promise.all(predicates.map((p) => p(value))).then((results) => results.reduce((acc, value) => acc && value, true));