Socket
Book a DemoInstallSign in
Socket

bacon.combines

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bacon.combines

Special purpose applicative Bacon combinator

0.1.3
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

npm version Bower version Build Status Code Coverage

TODO: convert doc from Kefir version

The default export of this library

import K from "bacon.combines"

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

K(x1, ..., xN, fn) === combine([x1, ..., xN], fn).skipDuplicates(identical)

where combineWith and skipDuplicates come from Kefir and identical 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.

Unlike with combine, any argument of 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 to combineTemplate.

Note: K is carefully optimized for space—if you write equivalent combinations using Kefir's own operators, they will likely take more memory.

Keywords

bacon

FAQs

Package last updated on 21 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.