TODO: convert doc from Kefir version
The default export of this library
is a special purpose Bacon observable combinator designed for combining properties for a sink that accepts both observables and constant values such as VDOM extended to accept observables.
Unlike typical observable combinators, when
K is invoked with only constants
(no observables), then the result is computed immediately and returned as a
plain value. This optimization eliminates redundant observables.
The basic semantics of
K can be described as
from Kefir and
from Ramda. Duplicates are skipped, because that can
reduce unnecessary updates. Ramda's
identical provides a semantics of
equality that works well within the context of embedding properties to VDOM.
combine, any argument
K is allowed to be
- a constant,
- an observable (including the combiner function), or
- an array or object containing observables.
In other words,
K also provides functionality similar
K is carefully optimized for space—if you write equivalent
combinations using Kefir's own operators, they will likely take more memory.