From 573355b02f6ae9306efeb235e058b558238585a8 Mon Sep 17 00:00:00 2001 From: Scott Prue Date: Thu, 31 Aug 2017 00:29:23 -0700 Subject: [PATCH] Clarified pre-install instructions. --- docs/redux.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/redux.md b/docs/redux.md index f343c3a9..5e57b3ff 100644 --- a/docs/redux.md +++ b/docs/redux.md @@ -8,7 +8,8 @@ when it comes to integrating with other modules such a [`react-redux`](https://g [`react-redux-firebase`](http://docs.react-redux-firebase.com/history/v2.0.0) provides simplified and standardized common redux/firebase logic. To add `react-redux-firebase` to your project: -1. Run `npm i --save react-redux react-redux-firebase@canary` *we point to canary here to get current progress with v2.0.0* +1. Make sure you already have `redux`, `react-redux`, `redux-thunk` installed (if not, run `npm i --save redux react-redux redux-thunk`) +1. Run `npm i --save react-redux-firebase@canary` *we point to canary here to get current progress with v2.0.0* 1. Add `firebaseStateReducer` under `firebase` key within reducer: **reducers.js** @@ -32,7 +33,7 @@ To add `react-redux-firebase` to your project: store.replaceReducer(makeRootReducer(store.asyncReducers)) }; ``` -1. Pass `react-native-firebase` instance into `reactReduxFirebase` when creating store: +1. Pass `react-native-firebase` App instance into `reactReduxFirebase` when creating store: **createStore.js** ```js @@ -61,7 +62,7 @@ To add `react-redux-firebase` to your project: const store = createStore( makeRootReducer(), - initialState, // initial state + initialState, compose( reactReduxFirebase(firebase, reduxFirebaseConfig), // pass initialized react-native-firebase app instance applyMiddleware(...middleware) @@ -70,6 +71,7 @@ To add `react-redux-firebase` to your project: return store; }; ``` + 1. Wrap in `Provider` from `react-redux`: **index.js** @@ -92,7 +94,7 @@ To add `react-redux-firebase` to your project: export default Main; ``` -1. Then you can use the `firebaseConnect` HOC to wrap your components. It helps to set listeners which gather data from Firebase and place it into redux: +1. Then you can use the `firebaseConnect` HOC to wrap your components. It makes it easy to set listeners which gather data from Firebase and place it into redux: **Home.js** ```js