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
### Features
* [X] Keeping data on logout - #125
* [X] Listeners now kept on state (follows byId/allIds pattern [from redux docs](http://redux.js.org/docs/recipes/reducers/UpdatingNormalizedData.html))
* [X] `ordered` reducer added for managing ordered state (`SET_ORDERED` no longer used)
* [X] `populate` works for profile (needed to remove share population logic)
* [X] Presence capability added to show currently logged in users and track user sessions (`presence` in config)
* [X] Firebase is no longer a dependency (build size, native compatibility, bundling for boilerplates, etc.) - #173, #131, #107
### Fixes/Enhancements
* Drop support for passing Firebase instance
* Auto profile population removed (profile population will require using populate)
* `isLoaded` and `isEmpty` logic simplified
* Tests passing with new syntax (including reducers)
* Drop support and deprecation warning for `profileDecorator` (use `profileFactory`)
* Drop support and deprecation warning for `distpatchOnUnsetListener` (use `distpatchOnUnsetListener`, note incorrect spelling)
* Tests no longer skipped from linting
* Tons of other code simplifications
// Follow Setup example with the following config:
78
-
constconfig= {
79
-
customAuthParameters: {
80
-
google: {
81
-
// prompts user to select account on every google login
82
-
prompt:'select_account'
83
-
}
84
-
}
85
-
}
86
-
```
87
-
88
79
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
-`userProfile`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**`null` Location on Firebase where user
61
63
profiles are stored. Often set to `'users'`.
64
+
-`presence`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**`null` Location on Firebase where of currently
65
+
online users is stored. Often set to `'presence'` or `'onlineUsers'`.
66
+
-`sessions`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**`sessions` Location on Firebase where user
67
+
sessions are stored (only if presense is set). Often set to `'presence'` or
68
+
`'onlineUsers'`.
62
69
-`enableLogging`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**`false` Whether or not firebase
63
70
database logging is enabled.
64
71
-`updateProfileOnLogin`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**`true` Whether or not to update
@@ -71,7 +78,7 @@ Default configuration options
71
78
empty auth changes such as `undefined` on initialization
72
79
(see [#137](https://github.com/prescottprue/react-redux-firebase/issues/137)).
73
80
Requires `v1.5.0-alpha` or higher.
74
-
-`autoPopulateProfile`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**`true` Whether or not to
81
+
-`autoPopulateProfile`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**`false` REMOVED FROM v2.0.0. Whether or not to
75
82
automatically populate profile with data loaded through
76
83
profileParamsToPopulate config.
77
84
-`setProfilePopulateResults`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**`true` Whether or not to
Copy file name to clipboardExpand all lines: docs/api/helpers.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ Detect whether items are loaded yet or not
5
5
**Parameters**
6
6
7
7
-`item`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Item to check loaded status of. A comma seperated list is also acceptable.
8
+
-`args`**...Any**
8
9
9
10
**Examples**
10
11
@@ -24,7 +25,7 @@ Detect whether items are empty or not
24
25
**Parameters**
25
26
26
27
-`item`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Item to check loaded status of. A comma seperated list is also acceptable.
Reducer for requesting state. Changed by `START` and `SET` actions.
3
+
Reducer for isInitializing state. Changed by `AUTHENTICATION_INIT_STARTED`
4
+
and `AUTHENTICATION_INIT_FINISHED` actions.
4
5
5
6
**Parameters**
6
7
7
-
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)](default {})** Current requesting redux state
8
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current isInitializing redux state (optional, default `false`)
8
9
-`action`**[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
10
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
9
11
10
12
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
11
13
12
-
# dataReducer
14
+
# requestingReducer
13
15
14
-
Reducer for data state. Changed by `LOGIN`, `LOGOUT`, and `LOGIN_ERROR`
15
-
actions.
16
+
Reducer for requesting state.Changed by `START`, `NO_VALUE`, and `SET` actions.
16
17
17
18
**Parameters**
18
19
19
-
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)](default {})** Current data redux state
20
-
-`action`**[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
20
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current requesting redux state (optional, default `{}`)
21
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
22
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
23
+
-`action.path`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of action that was dispatched
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
29
+
30
+
# requestedReducer
31
+
32
+
Reducer for requested state. Changed by `START`, `NO_VALUE`, and `SET` actions.
33
+
34
+
**Parameters**
35
+
36
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current requested redux state (optional, default `{}`)
37
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
38
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
39
+
-`action.path`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of action that was dispatched
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
45
+
46
+
# timestampsReducer
47
+
48
+
Reducer for timestamps state. Changed by `START`, `NO_VALUE`, and `SET` actions.
49
+
50
+
**Parameters**
51
+
52
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current timestamps redux state (optional, default `{}`)
53
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
54
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
55
+
-`action.path`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of action that was dispatched
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
23
61
24
62
# authReducer
25
63
26
-
Reducer for auth state. Changed by `LOGIN`, `LOGOUT`, and `LOGIN_ERROR`
27
-
actions.
64
+
Reducer for auth state. Changed by `LOGIN`, `LOGOUT`, and `LOGIN_ERROR` actions.
28
65
29
66
**Parameters**
30
67
31
-
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)](default {})** Current auth redux state
32
-
-`action`**[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
68
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current auth redux state (optional, default `{isLoaded:false}`)
69
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
70
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
33
71
34
72
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
35
73
@@ -40,35 +78,66 @@ Reducer for profile state. Changed by `SET_PROFILE`, `LOGOUT`, and
40
78
41
79
**Parameters**
42
80
43
-
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)](default null)** Current profile redux state
81
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current profile redux state (optional, default `{isLoaded:false}`)
44
82
-`action`**[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
83
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
45
84
46
85
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
47
86
48
-
# isInitializingReducer
87
+
# errorsReducer
49
88
50
-
Reducer for isInitializing state. Changed by `AUTHENTICATION_INIT_STARTED`
51
-
and `AUTHENTICATION_INIT_FINISHED` actions.
89
+
Reducer for errors state. Changed by `UNAUTHORIZED_ERROR`
90
+
and `LOGOUT` actions.
52
91
53
92
**Parameters**
54
93
55
-
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)](default false)** Current isInitializing redux state
56
-
-`action`**[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
94
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current authError redux state (optional, default `[]`)
95
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
96
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
57
97
58
98
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
59
99
60
-
# errorsReducer
100
+
# listenersReducer
61
101
62
-
Reducer for errors state. Changed by `UNAUTHORIZED_ERROR`
102
+
Reducer for listeners state. Changed by `UNAUTHORIZED_ERROR`
63
103
and `LOGOUT` actions.
64
104
65
105
**Parameters**
66
106
67
-
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)](default \[])** Current authError redux state
68
-
-`action`**[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
107
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current authError redux state (optional, default `[]`)
108
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
109
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
69
110
70
111
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
71
112
113
+
# dataReducer
114
+
115
+
Reducer for data state. Changed by `SET`, `SET_ORDERED`,`NO_VALUE`, and
116
+
`LOGOUT` actions.
117
+
118
+
**Parameters**
119
+
120
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current data redux state (optional, default `{}`)
121
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
122
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
123
+
-`action.path`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of action that was dispatched
124
+
125
+
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data state after reduction
126
+
127
+
# orderedReducer
128
+
129
+
Reducer for ordered state. Changed by `SET`, `SET_ORDERED`,`NO_VALUE`, and
130
+
`LOGOUT` actions.
131
+
132
+
**Parameters**
133
+
134
+
-`state`**\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Current data redux state (optional, default `{}`)
135
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
136
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
137
+
-`action.path`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of action that was dispatched
138
+
139
+
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data state after reduction
140
+
72
141
# firebaseStateReducer
73
142
74
143
Reducer for react redux firebase. This function is called
@@ -81,6 +150,7 @@ changes.
81
150
-`state`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Current Redux State
82
151
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Action which will modify state
83
152
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of Action being called
84
-
-`action.data`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of Action which will modify state
153
+
-`action.path`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of action that was dispatched
154
+
-`action.data`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Data associated with action
0 commit comments