Simple event bus for riot.js tags
Requires Riot 2.2+
-
Include riot-bus.js or riot-bus.min.js to your project
-
Add line code to all your tags
this.mixin(new RiotBusMixinClass())
OR do it via sharing mixin:
riot.mixin('RiotBusMixin',new RiotBusMixinClass())
this.mixin('RiotBusMixin')
To call event for all tags just add
this.bus.trigger('event',{some: "params"})
As is
Do not trigger bus event in any event handler