Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

rxprop

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

rxprop

RxJs based store for react - react component rxjs connector

latest
npmnpm
Version
1.0.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

React-RxJS connector/bridge RxProp

Simply connect RxJs Subject and BehaviorSubject to your react component.

Install project:

npm install rxprop --save

Use it as a higher order component or decorator ( if you have setup ):

import React from 'react';
import { BehaviorSubject } from 'rxjs';
import rxProp from 'rxprop';

export const Store = {
  currentUser: new BehaviorSubject(null)
}

class Hello extends React.Component {
  render() {
    return `Hello, ${this.props.user}`;
  }
}
export default rxProp({user: Store.currentUser})(Hello);

You can use this library as a simple store, a replacement for redux if you want.

Read more on React & RxJS

https://pixelplux.com/en/39/react-rxjs-store-you-dont-need-redux/

FAQs

Package last updated on 18 Jul 2019

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