When a user submit's the deleteGroup form inside the modal, we need to make a list of several functions dat have to be executed in a deferred chain.
For example: All([vCalls.deleteGroup(groupid), vCalls.deleteUser(user1), vCalls.deleteUser(user2)])
The exact vCalls that have to be executed are dynamic. Therefore we need a way to make that array of functions, but not executing them until we really return the all.
What's a proper way to do that?
The following example is not working; alle vCalls are executed as soon as their mentions:
When a user submit's the deleteGroup form inside the modal, we need to make a list of several functions dat have to be executed in a deferred chain. For example:
All([vCalls.deleteGroup(groupid), vCalls.deleteUser(user1), vCalls.deleteUser(user2)])
The exact vCalls that have to be executed are dynamic. Therefore we need a way to make that array of functions, but not executing them until we really return the all.What's a proper way to do that? The following example is not working; alle vCalls are executed as soon as their mentions:
var allvCallsArr = [vCalls.deleteGroup(groupid)] if($('#modal-delete-group input[name=delete-questions]').val() == 'yes') { allvCallsArr.push(vCalls.deleteQuestionsForGroup(getMapsForGroupResp.items[0].id, groupid)); } return All(allvCallsArr);