Skip to content
Advertisement

wrapMethod Meteor methods

I was looking into this presentation, building large meteor applications, and I like the idea of the wrapMethod(), but it seems like I can’t use it like on the example.

Here is my code.

JavaScript

But I got this error.

TypeError: Object # has no method ‘wrapMethod’

I’m missing something I know but just can’t find any information about this "wrapMethod"

Update

Also try with

JavaScript

Which doesn’t return an error but I don’t see the method on the global namespace.

EX.Accounts.Methods is clear with no methods.

Advertisement

Answer

I think the developer created the method wrapMethod on his PB obejct. As you can see here there is nothing called wrapMethod in Meteor. I guess they wrote something like this:

JavaScript

I think it’s kinda neat. Btw.: As you can see i like to name my anonymous functions. Makes debugging nicer.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement