Closed
Description
Is there a specific reason why you chose to use the nodejs cb style for the lifecycle hook functions?
Since we've got promises anyways, and internally it seems like you convert them into promises (by decorating $q, which isn't a very good idea) why not just wrap the return value in a $q.when
?
So instead of:
promise
.then(function (attrs) {
return DS.$q.promisify(definition.beforeValidate)(resourceName, attrs);
})
why not:
promise
.then(function(attrs){
return definition.beforeValidate(resourceName, attrs);
})
It would provide consistency in within the library and application code in how async is handled.
Metadata
Metadata
Assignees
Labels
No labels