Awesome
NOTE: This package is no longer being maintained. If you are interested in taking over as maintainer or are interested in the npm package name, get in touch by creating an issue.
Fynx is an architecture library for React. The fynx-decorators module provides store decorators for class-based React components.
Install
With NPM
npm install fynx-decorators
With Bower
bower install fynx-decorators
From source
git clone https://github.com/foss-haas/fynx-decorators.git
cd fynx-decorators
npm install
npm run dist
API
connect(store, name):Decorator
Creates a React decorator that updates the component's props by setting the prop identified by name
to the store's value whenever the store's value changes.
Automatically adds the store's current value to the component's initial props.
Registers the listener on componentDidMount
and unregisters it on componentWillUnmount
.
connectProp(propName, name):Decorator
Creates a React decorator that updates the component's props by setting the prop identified by name
to the value of the store in the outer prop propName
whenever the store's value changes.
Automatically adds the store's current value to the component's initial props and reacts to outer prop changes.
Registers the listener on componentDidMount
and unregisters it on componentWillUnmount
.
License
The MIT/Expat license. For more information, see http://foss-haas.mit-license.org/ or the accompanying LICENSE file.