mongoosejs / kareem

Next-generation take on pre/post function hooks
Apache License 2.0
82 stars 8 forks source link

pre vs. post hooks #26

Closed Uzlopak closed 2 years ago

Uzlopak commented 2 years ago

Is there a reason why pre can handle async but post can not?

vkarpov15 commented 2 years ago

What makes you think post hooks can't handle async? Here's an example from our docs: https://github.com/vkarpov15/kareem#it-supports-returning-a-promise-1

Uzlopak commented 2 years ago

I was looking if I could streamline pre and post function but pre is handling async stuff but post is not.

hasezoey commented 2 years ago

@Uzlopak is this "post hooks cannot handle async" based on that pre has isAsync but post has not?

Uzlopak commented 2 years ago

Yes