0.2.1 • Published 10 years ago

react-kefir v0.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 years ago

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

0.2.1

10 years ago

0.2.0

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago