sapo/Ink.js — pull request #18 by fabiosantoscode (2013-08-29 17:34:08+00:00)
Title: Adding observeMulti and throttle

Added `observeMulti` and `throttle` functions to Ink.Dom.Event.

- `throttle` makes it a tad easier to observe some events such as `mousemove`, and `window`'s `resize` and `scroll`, which are fired a LOT of times. By calling `InkEvent.throttle(func, ms)` on a function, you get a function which will be called at most once every `ms` milliseconds, ignoring every superfluous call.
- `observeMulti` is like `observe`, but it observes the selected event on a CSS selector which finds them, or an array-like object containing them.

A minor improvement: `Ink.Dom.Event.observe` and `observeMulti` now return the handler which was used, for use with `stopObserving` later.