Meteor-Community-Packages / meteor-collection-hooks

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

Use DDP._CurrentPublicationInvocation to get userId #223

Open zimme opened 7 years ago

zimme commented 7 years ago

Let's use DDP._CurrentPublicationInvocation to get the userId if it's available, otherwise fall back to the current method to be backwards-compatible.

Possible since https://github.com/meteor/meteor/pull/8629.

gregory commented 6 years ago

it's crazy how much time code is spent in the try/catch - would be much more efficient to rely on DDP._CurrentMethodInvocation.get() || DDP._CurrentPublicationInvocation.get();

zimme commented 6 years ago

@gregory I would happily accept a PR for this =)

gregory commented 6 years ago

Thanks @zimme - Not a blocker, will try to find some time for this :)