whenAll() and whenAny() functions