a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument (partial application). –Wikipedia
spent hours chasing down bugs from side effects 2. Code that mutates data requires following steps through code to understand what it is doing 3. Mutating lots of code can be expensive
internet, so here are some qualities. 1. Deal with events in a functional way 2. Create streams of events rather than event listeners 3. Free of side effects
no results for queries of length < 3 return Bacon.once([]); return Bacon.fromPromise(queryMovie(query)); } var text = $('#input') .asEventStream('keydown') .debounce(300) .map(function(event) { return event.target.value; }) .skipDuplicates(); // Only react to latest, in case they are out of order var suggestions = text.flatMapLatest(movieSearch); text.awaiting(suggestions).onValue(function(x) { if (x) $('#results').html('Searching...'); }); suggestions.onValue(function(results) { $('#results').html($.map(results, showMovie)); });