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
Copy file name to clipboardExpand all lines: README.md
+43-26Lines changed: 43 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,31 +19,31 @@
19
19
The [Material Example](https://github.com/prescottprue/react-redux-firebase/tree/master/examples/complete/material) is deployed to [demo.react-redux-firebase.com](https://demo.react-redux-firebase.com).
20
20
21
21
## Features
22
-
- Support for updating and nested props
23
-
-[Population capability](http://react-redux-firebase.com/docs/populate) (similar to mongoose's `populate` or SQL's `JOIN`)
22
+
- Integrated into redux
24
23
- Out of the box support for authentication (with auto load user profile)
25
-
- Firebase Database, Firestore, Auth, Storage, and Messaging Support
24
+
- Full Firebase Platform Support Including Real Time Database, Firestore, and Storage
25
+
- Automatic binding/unbinding of listeners through React Higher Order Components (`firebaseConnect` and `firestoreConnect`)
26
+
-[Population capability](http://react-redux-firebase.com/docs/populate) (similar to mongoose's `populate` or SQL's `JOIN`)
26
27
- Support small data ( using `value` ) or large datasets ( using `child_added`, `child_removed`, `child_changed` )
- Tons of examples of integrations including [`redux-thunk`](https://github.com/gaearon/redux-thunk) and [`redux-observable`](https://redux-observable.js.org/)
33
30
- Server Side Rendering Support
34
31
-[`react-native` support](/docs/recipes/react-native.md) using [native modules](http://docs.react-redux-firebase.com/history/v2.0.0/docs/recipes/react-native.html#native-modules) or [web sdk](/docs/recipes/react-native.md#jsweb)
35
32
36
33
## Install
37
34
38
35
```bash
39
-
npm install --save react-redux-firebase@next
36
+
npm install --save react-redux-firebase
40
37
```
41
38
42
39
## Use
43
40
44
-
Include `reactReduxFirebase`in your store compose function and `firebaseReducer`in your reducers:
41
+
Include `reactReduxFirebase`(store enhancer) and `firebaseReducer`(reducer) while creating your redux store:
// Setup react-redux so that connect HOC can be used
83
+
constApp= () => (
84
+
<Provider store={store}>
85
+
<Todos />
86
+
</Provider>
87
+
);
88
+
89
+
render(<App/>, document.getElementById('root'));
81
90
```
82
91
83
-
In components:
92
+
The Firebase instance can then be grabbed from context within your components (`withFirebase` and `firebaseConnect` Higher Order Components provided to help):
If you plan to use Firestore, you should checkout [`redux-firestore`][redux-firestore]. It integrates nicely with `react-redux-firebase` (v2 only) and it allows you to run Real Time Database and Firestore along side each other.
304
+
305
+
`react-redux-firebase` provides the `firestoreConnect` HOC (similar to `firebaseConnect`) for easy setting/unsetting of listeners.
306
+
307
+
Currently `react-redux-firebase` still handles auth when using [`redux-firestore`][redux-firestore] - The future plan is to also have auth standalone auth library that will allow the developer to choose which pieces they do/do not want.
292
308
293
309
## Starting A Project
294
310
@@ -308,7 +324,7 @@ Please visit the [FAQ section of the docs](http://docs.react-redux-firebase.com/
308
324
309
325
This project exists thanks to all the people who contribute.
Copy file name to clipboardExpand all lines: docs/FAQ.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
*[Complete Firebase Auth Integration](http://react-redux-firebase.com/docs/auth.html#examples) including `signInWithRedirect` compatibility for OAuth Providers
17
17
18
18
#### Well why not combine?
19
-
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.
19
+
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][gitter-url] if you haven't already since a ton of this type of discussion goes on there.
20
20
21
21
#### What about [redux-firebase](https://github.com/colbyr/redux-firebase)?
22
22
The author of [redux-firebase](https://github.com/colbyr/redux-firebase) has agreed to share the npm namespace! Currently the plan is to take the framework agnostic redux core logic of `react-redux-firebase` and [place it into `redux-firebase`](https://github.com/prescottprue/redux-firebase)). Eventually `react-redux-firebase` and potentially other framework libraries can depend on that core (the new `redux-firebase`).
@@ -34,8 +34,14 @@
34
34
35
35

36
36
37
-
5. How do I help?
37
+
5. Where is the `yarn.lock` file?
38
+
39
+
There isn't one, there is just a `package-lock.json`. `npm v5.x.x` adds support for a `package-lock.json` file which serves a similar purpose to a `yarn.lock` file. Instead of managing multiple lock files, the single `package-lock.json` contains exact version information for dependencies.
-`config`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Containing react-redux-firebase specific config
20
+
such as userProfile
21
+
-`config.userProfile`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Location on firebase to store user
22
+
profiles
23
+
-`config.enableLogging`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable Firebase
24
+
database logging
25
+
-`config.updateProfileOnLogin`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to update
26
+
profile when logging in. (default: `false`)
27
+
-`config.resetBeforeLogin`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to empty profile
28
+
and auth state on login
29
+
-`config.enableRedirectHandling`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable
-`config.onAuthStateChanged`**[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function run when auth state
-`config.enableEmptyAuthChanges`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable
34
+
empty auth changes. When set to true, `onAuthStateChanged` will be fired with,
35
+
empty auth changes such as undefined on initialization. See
36
+
[#137](https://github.com/prescottprue/react-redux-firebase/issues/137) for
37
+
more details. (default: `false`)
38
+
-`config.onRedirectResult`**[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function run when redirect
39
+
result is returned. Argument Pattern: `(authData, firebase, dispatch)`
40
+
-`config.customAuthParameters`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object for setting which
41
+
customAuthParameters are passed to external auth providers.
42
+
-`config.profileFactory`**[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying how user
43
+
profile is saved.
44
+
-`config.fileMetadataFactory`**[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying
45
+
how file meta data is written during file uploads
46
+
-`config.profileParamsToPopulate`**([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\|[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** Parameters within
47
+
profile object to populate
48
+
-`config.autoPopulateProfile`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to
49
+
automatically populate profile with data loaded through
50
+
profileParamsToPopulate config. (default: `true`)
51
+
-`config.setProfilePopulateResults`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to
52
+
call SET actions for data that results from populating profile to redux under
53
+
the data path. For example role parameter on profile populated from 'roles'
54
+
root. True will call SET_PROFILE as well as a SET action with the role that
55
+
is loaded (places it in data/roles). (default: `false`)
// Follow Setup example with the following config:
85
+
constconfig= {
86
+
customAuthParameters: {
87
+
google: {
88
+
// prompts user to select account on every google login
89
+
prompt:'select_account'
90
+
}
91
+
}
92
+
}
93
+
```
94
+
95
+
Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** That accepts a component and returns a Component which
96
+
wraps the provided component (higher order component).
0 commit comments