mrchimp/tock — pull request #21 by ydaniv (2014-12-25 12:49:28+00:00)
Title: Refactor Tock to an OO implementation

This refactor fixes misuse of `this` inside `_tick()` which contaminated global namespace.

This implementation is much more memory efficient since it's not redefining the inner functions of `Tock` on every instance generation. Instead they reuse all the module's private functions via closure and `Tock`'s public methods on its `prototype`.

Note that everything should remain the same, **except for passing reference to a method of a `Tock`'s instance**. This should be done with care since state is now managed in an OO way via `this`.