meteor-event-horizon icon indicating copy to clipboard operation
meteor-event-horizon copied to clipboard

EventHorizon.fire(), pass values?

Open ghost opened this issue 11 years ago • 4 comments

Possible to pass values when you fire a manual event?

ghost avatar Mar 24 '13 22:03 ghost

Yes. The first argument to EventHorizon.fire is the event name, and the optional second argument is an object that will be passed to the event handlers.

I'm curious what your use case is here so I can keep that in mind for future versions of the package.

On Sunday, March 24, 2013, jjk3 wrote:

Possible to pass values when you fire a manual event?

— Reply to this email directly or view it on GitHubhttps://github.com/belisarius222/meteor-event-horizon/issues/2 .

belisarius222 avatar Mar 24 '13 23:03 belisarius222

I am using Session to store a value and read it in the EVentHorizon.on() but I wanted to bypass this and pass a value that can be used directly in the on method.

ghost avatar Mar 24 '13 23:03 ghost

Cool! That's basically how I've been hoping people would use this. Please let me know if you run into any trouble making that work.

On Sun, Mar 24, 2013 at 4:52 PM, jjk3 [email protected] wrote:

I am using Session to store a value and read it in the EVentHorizon.on() but I wanted to bypass this and pass a value that can be used directly in the on method.

— Reply to this email directly or view it on GitHubhttps://github.com/belisarius222/meteor-event-horizon/issues/2#issuecomment-15372403 .

belisarius222 avatar Mar 25 '13 21:03 belisarius222

Sweet. Thank you. I am going to give this a try right now. It's clear that you've thought this out very well :+1:

Question, how do I make this work on server side? In my server/server.js, I write the on() method but doesn't seem to be working other than on the client? Did I overlook a step?

ghost avatar Mar 26 '13 05:03 ghost