New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flyd-lift-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flyd-lift-react

Lift React components to take Flyd streams.

2.2.0
latest
Source
npm
Version published
Weekly downloads
15
1400%
Maintainers
1
Weekly downloads
 
Created
Source

Lift React Component

NPM version Build status Dependencies

A higher order React component for use with flyd.

Combining React and flyd for an elm-like architecture couldn't be easier. Just look at this example:

// Write an ordinary React component that takes some props:
const Counter = ({value, increment}) => (
    <div onClick={increment}>
        {value}
    </div>
);

// Lift it
import Lift from 'flyd-lift-react';
const LiftedCounter = Lift(Counter);

// Use it
import { stream } from 'flyd';
const clicks = stream();
const value = stream([clicks], self => self((self() || 0) + 1));

import { render } from 'react-dom';
render(
    <LiftedCounter value={value} increment={e => clicks(e)} />,
    document.body
);

Lift is a higher order React component.

  • Pass a mix of streams an ordinary values as props to your lifted component.
  • The component being lifted will only receive normal values as props.
  • If a stream updates, so so will the lifted component.

Keywords

flyd

FAQs

Package last updated on 21 May 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