Callback is fine too, I have no particular motivation for one vs other here. I guess you'd pass the cb to the triggers setup method?


On 2013-12-13, at 15:36, Tavish Armstrong <notifications@github.com> wrote:

> In main/src/org/korsakow/player/model/Model.js:
> 
> > +	cancel: function (env) {
> > +		this.trigger.cancel();
> > +	}
> > +});
> > +
> > +/**
> > + * Executes an event's rules after <time> seconds.
> > + */
> > +org.korsakow.domain.trigger.SnuTime = Class.register('org.korsakow.domain.trigger.SnuTime', org.korsakow.domain.DomainObject, {
> > +	initialize: function($super, id, time) {
> > +		$super(id);
> > +		this.id = id;
> > +		this.time = time;
> > +		this.cancelled = false;
> > +	},
> > +	setup: function (callback) {
> Agreed, that's a much better way to do the timeupdate bind. I wonder about the trigger communicating with the event via another jQuery event, though -- seems like a callback would make it easier to understand the control flow. Is there some other reason why we'd want that extra step?
> 
> \
> Reply to this email directly or view it on GitHub.