You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Populate functionality now includes object notation like so:
```js
{path: '/todos', populates: [{ child: 'owner', root: 'users' }]
```
* `reactReduxFirebase` function now passes through `enhancer` argument of `createStore`
* email now included in default user profile with external providers
* `onAuthStateChanged` function exposed in config (for setting auth info to other libraries such as [`react-ga`](https://www.npmjs.com/package/react-ga))
* Coverage Calculation fixed (now using `istanbul` directly)
* Tests added for utils
* Multiple internal optimizations
* `firebase` and `lodash` dependencies updated
* `no-console` rule added to `.eslintrc` to keep `console` out of src
* README updated with `redux-observable` integration
// import { firebaseConnect } from 'react-redux-firebase'
114
-
// @firebaseConnect( [
115
-
// '/todos'
116
-
// ])
117
-
118
-
@firebase( [
113
+
@firebaseConnect( [
119
114
'/todos'
120
115
// { type: 'once', path: '/todos' } // for loading once instead of binding
121
116
])
122
117
@connect(
123
-
({firebase}) => ({
118
+
({ firebase }) => ({
119
+
// Connect todos prop to firebase todos
124
120
todos:dataToJS(firebase, '/todos'),
125
121
})
126
122
)
@@ -172,7 +168,7 @@ Alternatively, if you choose not to use decorators:
172
168
173
169
```javascript
174
170
175
-
constwrappedTodos=firebase([
171
+
constwrappedTodos=firebaseConnect([
176
172
'/todos'
177
173
])(Todos)
178
174
exportdefaultconnect(
@@ -201,14 +197,14 @@ The simple example implemented using decorators built from the output of [create
201
197
An example that user Material UI built on top of the output of [create-react-app](https://github.com/facebookincubator/create-react-app)'s eject command. Shows a list of todo items and allows you to add to them. This is what is deployed to [react-redux-firebase.firebaseapp.com](https://react-redux-firebase.firebaseapp.com/).
202
198
203
199
## Using with `redux-thunk`
204
-
If you user using `redux-thunk`, make sure to set up your thunk middleware using it's redux-thunk's `withExtraArgument` method so that firebase is available within your actions. Here is an example `createStore` function that adds `getFirebase` as third argument along with a thunk that uses it:
200
+
If you are using `redux-thunk`, make sure to set up your thunk middleware using it's redux-thunk's `withExtraArgument` method so that firebase is available within your actions. Here is an example `createStore` function that adds `getFirebase` as third argument along with a thunk that uses it:
If you are using `redux-observable`, make sure to set up your redux-observable middleware so that firebase is available within your epics. Here is an example `combineEpics` function that adds `getFirebase` as third argument along with an epic that uses it:
*[populate functionality](https://prescottprue.gitbooks.io/react-redux-firebase/content/populate.html) (similar to mongoDB or SQL JOIN)
257
271
*[`profileDecorator`](https://prescottprue.gitbooks.io/react-redux-firebase/content/config.html) - change format of profile stored on Firebase
258
272
*[`getFirebase`](https://prescottprue.gitbooks.io/react-redux-firebase/content/thunks.html) - access to firebase instance that fires actions when methods are called
259
-
*[capability for thunk integration](https://prescottprue.gitbooks.io/react-redux-firebase/content/thunks.html)- using `getFirebase` and `thunk.withExtraArgument`
273
+
*[integrations](https://prescottprue.gitbooks.io/react-redux-firebase/content/thunks.html)for [`redux-thunk`](https://github.com/gaearon/redux-thunk) and [`redux-observable`](https://redux-observable.js.org) - using `getFirebase`
260
274
*[access to firebase's `storage`](https://prescottprue.gitbooks.io/react-redux-firebase/content/storage.html) method
261
275
*`uniqueSet` method helper for only setting if location doesn't already exist
276
+
* Object or String notation for paths (`[{ path: '/todos' }]` equivalent to `['/todos']`)
277
+
* Action Types and other Constants are exposed for external usage (such as `redux-observable`)
262
278
263
279
#### Well why not combine?
264
-
I am in the process of writing up an article comparing the two, including the difference in defaults/utils. Maybe a section should be included in the docs as well?
265
-
266
-
Also, I have been talking to the author of redux-react-firebase about combining, but we are not sure that the users of both want that at this point. Join us on [the redux-firebase gitter](https://gitter.im/redux-firebase/Lobby) if you haven't already since a ton of this type of discussion goes on there.
280
+
I have been talking to the author of [redux-react-firebase]() about combining, but we are not sure that the users of both want that at this point. Join us on [the redux-firebase gitter](https://gitter.im/redux-firebase/Lobby) if you haven't already since a ton of this type of discussion goes on there.
267
281
268
282
**Bottom line:** The author of redux-react-firebase was absent when functionality was needed by me and others, so this library was created.
269
283
270
284
2. Why use redux if I have Firebase to store state?
271
285
272
286
This isn't a super quick answer, so I wrote up [a medium article to explain](https://medium.com/@prescottprue/firebase-with-redux-82d04f8675b9)
Special thanks to [Tiberiu Craciun](https://github.com/tiberiuc) for creating [redux-react-firebase](https://github.com/tiberiuc/redux-react-firebase), which this project is heavily based on.
297
+
Special thanks to [Tiberiu Craciun](https://github.com/tiberiuc) for creating [redux-react-firebase](https://github.com/tiberiuc/redux-react-firebase), which this project was originally based on.
0 commit comments