davidcl64/litelist — pull request #7 by davidcl64 (2014-05-16 17:00:47+00:00)
Title: ViewBuffer - refactor view buffer management into separate module

The buffer management code has been refactored into a ViewBuffer module. This helps simplify the logic in LiteList itself and exposes the buffer logic for easier testing.

### Breaking Changes:

- Height is now exposed in a metrics object rather than directly on items. rivets users will need to change the markup to account for this. See the rivets demo for an example.
- The raw data is not exposed as data (e.g. item.data) rather than item.item. This should help keep things a bit more clear and better separates the circular buffer view from the underlying data array. See the examples for usage.
- LiteList got a major refactor. The public API is largely the same, but anyone relying on the internals (_ prefixed methods and/or properties) will likely be broken.
- RivetsLiteList now directly inherits from LiteList rather than aggregating it in and selectively exposing properties and methods.

*Note: all examples have been updated to work with the changes.*

### Non-breaking changes

- Tests contain additional refactoring to expect the ViewBuffer changes
- Tests now support source maps to aid in tracking the source of failures.

### new APIs

- clear() resets the view buffer back to empty
- forEachInView() iterates all items currently in the view portion of the ViewBuffer