Broadcast events from my plugin
I have a little plugin that works fairly well for what i need it to do. It has defaults for properties and I let clients override those with their own values. I also have default functionality for some functions and users can also override those to introduce non-default behaviors when needed.
The piece I can figure out is how I can provide event broadcasts from within my plugin that calling clients can listen in on and react to.
Let me try to clarify - inside of my plugin something happens when a user clicks a button (either the default function or the override function the user provided when creating the plugin reference). What I would like is for the plugin itself to tell the world that the event has happened. Right now I have this
- $this.trigger('myClick',param);
What i would like is for the calling client (when they create the plugin ref or even after) to be able to know when that event is raised in my plugin.
Not sure if i am explaining that correctly or not or if it is even possible.
Any suggestions?