raimohanska/bacon.js — pull request #48 by thenikso (2013-01-21 21:49:51+00:00)
Title: Add `diff` method to Observable

Maybe the name is not the best one but `diff` would solve the current situation: You have a stream (or property) and you want to have a new Property containing the difference between the current and previous value of the original stream.

Lets stay I have a stream sending string (myStringSignal) and a function that takes two strings and returns the difference between them (like [this](http://ejohn.org/projects/javascript-diff-algorithm/) found with a google search) we could do:

myStringSignal.diff('', stringDiff)

Because comparing previous and current values can be used for more than just calculate a difference, a more generic name may be needed like `mapWithPrevious`. Ideas and comments are welcome :smiley: