Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

[Question] How to use result of server method within client side collection hook? #114

Closed serkandurusoy closed 7 years ago

serkandurusoy commented 9 years ago

I'm trying to set up some server and client side before.insert and before.update hooks and I need the document to be enhanced with the result of a server side method.

I cannot do it purely on the client due to lack of certain libraries on the client.

I cannot do it purely on the server because I need the result immediately without which the UI flickers and jumps around too much.

The problem is the server side method being called asynchronously on the client leaving me with undefined.

Is there a clean way to run a blocking function that I can use within a client side before.insert / before.update hook to get some result from the server?

zimme commented 7 years ago

There's no support for async hooks right now, it's being tracked in #71.