meteor-collection-hooks icon indicating copy to clipboard operation
meteor-collection-hooks copied to clipboard

Asynchronous hooks

Open aramk opened this issue 9 years ago • 5 comments

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);

aramk avatar Nov 17 '14 01:11 aramk

Why don't you just put a delayed operation in a hook?

mizzao avatar Nov 17 '14 03:11 mizzao

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.

aramk avatar Nov 17 '14 09:11 aramk

+1

dalgard avatar Apr 30 '15 00:04 dalgard

+1

ggn06awu avatar Jan 05 '16 13:01 ggn06awu

+1

selarom-epilef avatar Nov 01 '16 00:11 selarom-epilef