UNPKG

marko-widgets

Version:

Module to support binding of behavior to rendered UI components rendered on the server or client

22 lines (18 loc) 453 B
function Widget(config) { this.name = config.name; var self = this; if (config.channel) { require('raptor-pubsub').channel(config.channel).on('emitTestEvent2', function() { self.emitTestEvent2(); }); } } Widget.prototype = { emitTestEvent1: function() { this.emit('testEvent', 'a', 'b'); }, emitTestEvent2: function() { this.emit('testEvent'); } }; exports.Widget = Widget;