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
* Docs are now part of repo (source downloaded from [gitbook.com version](https://www.gitbook.com/book/prescottprue/react-redux-firebase/details)) and published to [react-redux-firebase.com](http://react-redux-firebase.com)
* docs npm scripts added:
* `docs:clean` - cleans docs folders
* `docs:prepare` - prepares for doc generation (installs gitbook-cli)
* `docs:api` - generates API Reference section of docs from comments in code using [`documentation.js`](http://documentation.js.org/)
* `docs:build` - builds docs into gitbook
* `docs: watch` - builds docs into gitbook while watching for changes
* `docs: publish` - publish docs to `gh-pages` branch (pointed to [react-redux-firebase.com](http://react-redux-firebase.com) using CNAME file)
Copy file name to clipboardExpand all lines: README.md
+27-16
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,10 @@
15
15
16
16
View deployed version of [Material Example](https://github.com/prescottprue/react-redux-firebase/tree/master/examples/complete/material)[here](https://redux-firebasev3.firebaseapp.com/)
17
17
18
-
19
18
## Features
20
19
- Integrated into redux
21
20
- Support for updating and nested props
22
-
-[Population capability](https://prescottprue.gitbooks.io/react-redux-firebase/content/populate.html) (similar to mongoose's `populate` or SQL's `JOIN`)
21
+
-[Population capability](http://react-redux-firebase.com/docs/populate) (similar to mongoose's `populate` or SQL's `JOIN`)
23
22
- Out of the box support for authentication (with auto load user profile)
24
23
- Firebase Storage Support
25
24
- Support small data ( using `value` ) or large datasets ( using `child_added`, `child_removed`, `child_changed` )
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/).
207
+
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 [redux-firebasev3.firebaseapp.com](https://redux-firebasev3.firebaseapp.com/).
208
+
209
+
## Discussion
210
+
211
+
Join the [redux-firebase gitter](https://gitter.im/redux-firebase/Lobby).
204
212
205
213
## Using with `redux-thunk`
206
214
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:
1. How is this different than [`redux-react-firebase`](https://github.com/tiberiuc/redux-react-firebase)?
274
285
275
286
This library was actually originally forked from redux-react-firebase, but adds extended functionality such as:
276
-
*[populate functionality](https://prescottprue.gitbooks.io/react-redux-firebase/content/populate.html) (similar to mongoDB or SQL JOIN)
277
-
*[`profileDecorator`](https://prescottprue.gitbooks.io/react-redux-firebase/content/config.html) - change format of profile stored on Firebase
278
-
*[`getFirebase`](https://prescottprue.gitbooks.io/react-redux-firebase/content/thunks.html) - access to firebase instance that fires actions when methods are called
279
-
*[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`
280
-
*[access to firebase's `storage`](https://prescottprue.gitbooks.io/react-redux-firebase/content/storage.html) method`
287
+
*[populate functionality](http://react-redux-firebase.com/docs/populate) (similar to mongoDB or SQL JOIN)
288
+
*[`profileDecorator`](http://react-redux-firebase.com/docs/config) - change format of profile stored on Firebase
289
+
*[`getFirebase`](http://react-redux-firebase.com/docs/thunks) - access to firebase instance that fires actions when methods are called
290
+
*[integrations](http://react-redux-firebase.com/docs/thunks) for [`redux-thunk`](https://github.com/gaearon/redux-thunk) and [`redux-observable`](https://redux-observable.js.org) - using `getFirebase`
291
+
*[access to firebase's `storage`](http://react-redux-firebase.com/docs/storage) method`
281
292
*`uniqueSet` method helper for only setting if location doesn't already exist
282
293
* Object or String notation for paths (`[{ path: '/todos' }]` equivalent to `['/todos']`)
283
-
* Action Types and other Constants are exposed for external usage (such as `redux-observable`)
294
+
* Action Types and other Constants are exposed for external usage (such as with `redux-observable`)
284
295
285
296
#### Well why not combine?
286
-
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.
297
+
I have been talking to the author of [redux-react-firebase](https://github.com/tiberiuc/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.
287
298
288
299
**Bottom line:** The author of redux-react-firebase was absent when functionality was needed by me and others, so this library was created.
-`config`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Containing react-redux-firebase specific config such as userProfile
15
+
-`config.userProfile`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Location on firebase to store user profiles
16
+
-`config.enableLogging`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Location on firebase to store user profiles. default: `false`
17
+
-`config.profileDecorator`**[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Location on firebase to store user profiles. default: `false`
18
+
-`config.updateProfileOnLogin`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to update profile when logging in. default: `false`
19
+
-`config.profileParamsToPopulate`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to update profile when logging in. default: `false`
Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** That accepts a component a returns a wrapped version of component
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2
+
3
+
# firebaseConnect
4
+
5
+
**Extends React.Component**
6
+
7
+
Higher Order Component that automatically listens/unListens
8
+
to provided firebase paths using React's Lifecycle hooks.
9
+
10
+
**Parameters**
11
+
12
+
-`watchArray`**[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of objects or strings for paths to sync from Firebase
13
+
14
+
**Examples**
15
+
16
+
_Basic_
17
+
18
+
```javascript
19
+
// this.props.firebase set on App component as firebase object with helpers
// pass todos list from redux as this.props.todosList
51
+
exportdefaultconnect(({ firebase }) => ({
52
+
todosList:dataToJS(firebase, 'todos')
53
+
}))(fbWrapped)
54
+
```
55
+
56
+
Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** that accepts a component to wrap and returns the wrapped component
0 commit comments