meteor-collection-hooks
meteor-collection-hooks copied to clipboard
Asynchronous hooks
Is it possible to allow asynchronous hooks to delay the execution of the underlying operation? This could be achieved like so:
var done = this.async();
setTimeout(function() {
done();
}, 2000);
Why don't you just put a delayed operation in a hook?
I'm actually throwing an exception to prevent the underlying operation from taking place for validation purposes. In this case the validation is asynchronous, so by the time the validation occurs it's too late to prevent the underlying operation.
+1
+1
+1