emberjs/ember.js — pull request #3696 by twokul (2013-11-05 17:43:58+00:00)
Title: [FEATURE Composable Computed Properties]

This feature allows you to combine (compose) different computed
properties together. So it gives you a really nice "functional
programming" like syntax to deal with complex expressions.

Example:

var sort = Ember.computed.sort,
union = Ember.computed.union,
equal = Ember.computed.equal,
mapBy = Ember.computed.mapBy,
not = Ember.computed.not,
compare = Ember.compare,
and = Ember.computed.and;

person = Ember.Object.extend(
napTime: and(
equal('state', 'sleepy'),
not('thirsty'),
not('hungry')
)
).create({
state: 'sleepy',
thirsty: true,
hungry: false
}),

kitties = Ember.Object.extend(
allKitties: sort(
union(
mapBy('whiteKitties', 'name'),
mapBy('blackKitties', 'name')
),
compare
)
).create({
whiteKitties: Ember.A([{
name: 'whiskeys'
}, {
name: 'bagels'
}]),
blackKitties: Ember.A([{ name: 'little boots' }]),
});

person.get('napTime') => false
person.set('thirsty', false)
person.get('napTime') => true

kitties.get('allKitties') => ['bagels', 'little boots', 'whiskeys']

Kudos to brilliant @hjdivad for his help.