Connecting components to Alt stores
Install
npm install alt-store-connect --save
connectToStores
wraps a React component and control its props with data coming from Alt stores.
This module supports React 16
Expects the Component to have two static methods:
getStores()
: Should return an array of stores.getPropsFromStores(props)
: Should return the props from the stores.
Usage Examples
ES6 Class Higher Order Component
;;; Component static { return myStore; } static { return myStore; } { // Use this.props like normal... } MyComponent;
ES7 Decorator
@connectToStores static { return myStore } static { return myStore } { // Use this.props like normal... }