react-rxk
TypeScript icon, indicating that this package has built-in type declarations

7.0.0 • Public • Published

react-rx

Higher order component to make any component accept RxJS observables and promises as props

Create a component

interface MyProps {
    time: number;
}
class MyComp extends React.Component<MyProps> {
    render() {
        return (
            <div>
                <label>Time is: </label>{this.props.time}
            </div>)
    }
}

Use the Rx to pass observables as props

class AnotherComp extends React.Component {
    timer = rx.timer(1000);
 
    render() {
        return <Rx
            render={MyComp}
            props={{
                //time property accepts number | Observable<number> | Promise<number>
                time: this.timer
            }}
        />;
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-rxk

Weekly Downloads

25

Version

7.0.0

License

UNLICENSED

Unpacked Size

53.2 kB

Total Files

35

Last publish

Collaborators

  • rafaelsalguero