redux-devshare
redux-devshare is a redux connector for devshare.
Getting Started
Install through NPM
-
Install:
npm install --save redux-devshare
-
Include and use
redux-devshare
when creating redux middleware, when calling an action, or when combining reducers (examples in Documentation section below).
Examples
Simple example coming soon
- devshare-site
- generator-react-firebase - The output of this generator uses redux-devshare
Documentation
Middleware
const createStoreWithMiddleware = createStore
Reducers
Add reducers to combineReducers function:
const account projects entities = Reducers let rootReducer =
Actions
Example of using Actions from redux-devshare
in a smart/linked component (also known as a "container"):
{ superprops } { e const testLogin = username: 'test' password: 'asdfasdf' thisprops } { return <div className="App"> <button onClick= thisonLoginClick > Login </button> </div> } // Place state of redux store into props of component { return account: stateaccount } // Place action methods into props { return } mapStateToProps mapDispatchToPropsMain