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
* Fixes issue with deep listener paths - #219, #221
* react `v16.0.0-0` added to peer dependencies
* Webpack updated to `v3.4.1`
* `presence` and `sessions` options support passing a function:
```js
{
userProfile: 'users',
// list of online users organize by group parameter
presence: (user) => `presence/${user.group}`,
sessions: (user) => `sessions/${user.group}`
}
```
* `sessions` option can now be set to null to not writing user sessions when using `presence`
* Removed unnecessary constructor from `FirebaseConnect` component
* `combineReducers` is now internal instead of being imported from redux (shrinks bundle size and limits dependencies)
* [Material-UI example](https://github.com/prescottprue/react-redux-firebase/tree/v2.0.0/examples/complete/material) updates (Navbar state uses auth state instead of profile state)
Copy file name to clipboardExpand all lines: docs/api/connect.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,8 +44,6 @@ to provided firebase paths using React's Lifecycle hooks.
44
44
45
45
**Parameters**
46
46
47
-
-`props`
48
-
-`context`
49
47
-`watchArray`**[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of objects or strings for paths to sync
50
48
from Firebase. Can also be a function that returns the array. The function
51
49
is passed the current props and the firebase object.
Copy file name to clipboardExpand all lines: docs/api/constants.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,11 +71,12 @@ Default configuration options
71
71
72
72
-`userProfile`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**`null` Location on Firebase where user
73
73
profiles are stored. Often set to `'users'`.
74
-
-`presence`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**`null` Location on Firebase where of currently
75
-
online users is stored. Often set to `'presence'` or `'onlineUsers'`.
76
-
-`sessions`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**`sessions` Location on Firebase where user
74
+
-`presence`**([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\|[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function))**`null` Location on Firebase where of currently
75
+
online users is stored. Often set to `'presence'` or `'onlineUsers'`. If a function
76
+
is passed, the arguments are: `(currentUser, firebase)`.
77
+
-`sessions`**([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\|[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function))**`sessions` Location on Firebase where user
77
78
sessions are stored (only if presense is set). Often set to `'sessions'` or
78
-
`'userSessions'`.
79
+
`'userSessions'`. If a function is passed, the arguments are: `(currentUser, firebase)`.
79
80
-`enableLogging`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**`false` Whether or not firebase
80
81
database logging is enabled.
81
82
-`preserveOnLougout`**[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)**`null` Data parameters to preserve when
Copy file name to clipboardExpand all lines: docs/recipes/routing.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@ Progress on supporting react-router 4 [is tracked within this issue](https://git
13
13
Routing can be changed based on data by using react lifecycle hooks such as `componentWillMount`, and `componentWillReceiveProps` to route users. This can be particularly useful when doing things such as route protection (only allowing user to view a route if they are logged in):
0 commit comments