The logo of Bacon.js
library is as follows:
The mustachioed hipster of functional programming libraries, Bacon.js
is itself a library for functional reactive programming. Functional reactive programming just means that functional design patterns are used to represent values that are reactive and always changing, like the position of the mouse on the screen, or the price of a company's stock. In the same way that Lazy can get away with creating infinite sequences by not calculating the value until it's needed, Bacon can avoid having to calculate ever-changing values until the very last second.
What are called sequences in Lazy are known as EventStreams and Properties in Bacon because they're more suited for working with events (onmouseover
, onkeydown
, and so on) and reactive properties (scroll position, mouse position, toggles, and so on).
Bacon.fromEventTarget(document.body, "click") .onValue(function() { alert("Bacon!") });
Bacon is a little bit older than Lazy but its feature set is about half the size and its community enthusiasm is about equal.