bitovi/syn — pull request #28 by bendemboski (2014-02-11 19:32:55+00:00)
Title: Make syn compatible with frameworks with managed timers such as Ember.js

Allow configuration of timer scheduling. When using syn within some frameworks (e.g. Ember), asynchronous callbacks need to be managed so they are executed within a run loop. Since syn internally makes use of setTimeout, this makes it incompatible with such frameworks.

This commit supports replacing calls to setTimeout with calls to a configured method such as a framework-supplied method for scheduling timers (in Ember's case, Ember.run.later()). Thus, by just setting

Syn = { schedule: function (fn, ms) { Ember.run.later(window, fn, ms); } };

before loading syn.js, syn can be made compatible with Ember testing (and similarly for other frameworks).