raimohanska/bacon.js — pull request #45 by lenary (2013-01-02 22:32:14+00:00)
Title: Added Sliding Windows

For various things (like drawing graphs with d3), sliding windows are really useful. For instance, see the example in examples/sliding_window.html (which is a Bacon-based copy of http://mbostock.github.com/d3/tutorial/bar-2.html )

Hence, I implemented them for event streams. You get an array up to `n` values (less when a stream hasn't made enough values yet).

The implementation is simple, though I spent lots of this evening working on it, so various commits go back and forth.

I really like the use of FRP for websites, and wish you good luck with the project.