knockout/knockout — pull request #695 by SteveSanderson (2013-08-21 12:48:34+00:00)
Title: Add support of filters/projections for observableArrays

A common scenario where experience from usage of KnockoutJS can be improved is having an observableArray of elements that is not binded directly to HTML, but first projected to a set different items, or filtered by a condition.

Would be great to have something similar to:

var array = ko.observableArray([]);
var filtered = array.filter(function(item) { /* condition */ });
var projection = array.select(function(item) { /* selector */ });

Right now you can achieve this by using a computed observable, but this will mean that every item of resulting array will be tested against condition/selector if any item of initial collection changes, and thus whole array will be rebound, that is not effective in terms of performance.
The fact of recreation is itself crucial as it may result in the loss of state for items that were recreated, in the case it was a projection.