baconjs / bacon.matchers

Matchers API for Bacon.js
MIT License
21 stars 6 forks source link

Added optional field-extractor to where clauses #7

Closed mkaemmerer closed 10 years ago

mkaemmerer commented 10 years ago

This branch adds the ability to pass field-keys to where, in much the same way that you can call observable.map(".key").

It's useful to be able to filter or match on a field instead of the entire object. For example, if I have an event stream of records like {type: "click", data: ...}, I might want to match all objects with a certain type field: e.g. observable.where(".type").isEqualTo("click").

raimohanska commented 10 years ago

Awesome!