I’m trying to use custom event publishing using skuid.events.publish and skuid.events.subscribe. The basic event system is working, but I’m having problems getting the data argument to work. If I publish with:
skuid.events.publish('my.custom.event', 'my argument')
I get an error during the publishing:
Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type
If instead I publish using a generic object for the data parameter, such as:
skuid.events.publish('my.custom.event', {myarg: 'my argument'})
the publish works fine, and the subscribe handler gets called. However, the data argument passed to the handler is ‘undefined’ rather than containing my custom object. My handler looks something like this:
skuid.events.subscribe('my.custom.event', function(data) { console.log(data); });
Any hints on what I might be doing wrong?
Thanks,
- Chris