New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-kefir

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-kefir

Connect Kefir observables to React components

latest
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

react-kefir

Connect Kefir observables to React components

Test Coverage Build Status

npm install --save react-kefir

Connector(component: ReactComponent): ReactComponent

This higher-order component automatically subscribes to observable props and keeps the wrapped component updated. That allows us to treat continuous values as effectively discrete.

import { Connector } from 'react-kefir'

Usage

Given a component (A),

let A = (props) => (<span>{props.v}</span>)

and an infinite stream of values (S),

let _i = 0
let S = fromPoll(1000, () => ++_i).toProperty(() => 0)
•---•--->---•---•--->
0   1  ...  n   n+1

apply connector, and render:

A = Connector(A)
render(<A v={S} />, document.body)

Now, sit back and observe the passage of time!

Example

  • View on JSFiddle

Keywords

react

FAQs

Package last updated on 24 Feb 2016

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