I'm having an issue with the node sequelize library. When using the success promise as shown below:
for (index = 0; index < models.length; index++) {
model = models[index];
model.drop().success(function() {
dropTableCompleteCheck();
});
}
JSHint complains and rightly highlights the code issue "Don't make functions within a loop". To overcome this issue I've tried replacing the above code with the following:
for (index = 0; index < models.length; index++) {
model = models[index];
model.drop().success(dropTableCompleteCheck());
}
This removes the JSHint issue, but now Node sequelize is now throwing the following uncaught exception:
error: Uncaught application error:
TypeError: listener must be a function
I'm trying to call a function on the success promise callback, and remove the JSHint issue at the same time. Is there another way of doing this that does both, I'd be happy with any pointers.
Thanks for your time.