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
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** HOC that accepts a watchArray and wraps a component
34
+
Returns **[Function][4]** HOC that accepts a watchArray and wraps a component
35
35
36
36
## firebaseConnect
37
37
@@ -42,7 +42,7 @@ to provided firebase paths using React's Lifecycle hooks.
42
42
43
43
**Parameters**
44
44
45
-
-`watchArray`**[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of objects or strings for paths to sync
45
+
-`watchArray`**[Array][5]** Array of objects or strings for paths to sync
46
46
from Firebase. Can also be a function that returns the array. The function
47
47
is passed the current props and the firebase object.
48
48
@@ -72,7 +72,7 @@ const enhance = compose(
72
72
})
73
73
)
74
74
// use enhnace to pass todos list as props.todos
75
-
constTodos=enhance(({ todos }) =>
75
+
constTodos=enhance(({ todos }))=>
76
76
<div>
77
77
{JSON.stringify(todos, null, 2)}
78
78
</div>
@@ -123,4 +123,14 @@ export default compose(
123
123
)(SomeComponent)
124
124
```
125
125
126
-
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** that accepts a component to wrap and returns the wrapped component
126
+
Returns **[Function][4]** that accepts a component to wrap and returns the wrapped component
Copy file name to clipboardExpand all lines: docs/api/enhancer.md
+34-22Lines changed: 34 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
### Table of Contents
4
4
5
-
-[reactReduxFirebase](#reactreduxfirebase)
5
+
-[reactReduxFirebase][1]
6
6
7
7
## reactReduxFirebase
8
8
@@ -12,22 +12,22 @@ along side applyMiddleware.
12
12
13
13
**Parameters**
14
14
15
-
-`firebaseInstance`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Initiated firebase instance (can also
15
+
-`firebaseInstance`**[Object][2]** Initiated firebase instance (can also
16
16
be library following Firebase JS API such as `react-native-firebase`)
17
-
-`config`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Containing react-redux-firebase specific configuration
18
-
-`config.userProfile`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Location on firebase to store user profiles
19
-
-`config.enableLogging`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable Firebase database logging.
17
+
-`config`**[Object][2]** Containing react-redux-firebase specific configuration
18
+
-`config.userProfile`**[String][3]** Location on firebase to store user profiles
19
+
-`config.enableLogging`**[Boolean][4]** Whether or not to enable Firebase database logging.
20
20
**Note**: Only works if instance has enableLogging function.
21
-
-`config.profileFactory`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying how user profile is saved.
22
-
-`config.presence`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Location on Firebase to store currently
21
+
-`config.profileFactory`**[Function][5]** Factory for modifying how user profile is saved.
22
+
-`config.presence`**[Boolean][4]** Location on Firebase to store currently
23
23
online users list. Often set to `'presence'` or `'onlineUsers'`.
24
-
-`config.sessions`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Location on Firebase where user
24
+
-`config.sessions`**[Boolean][4]** Location on Firebase where user
25
25
sessions are stored (only if presense is set). Often set to `'sessions'` or `'onlineUsers'`.
26
-
-`config.updateProfileOnLogin`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to update
26
+
-`config.updateProfileOnLogin`**[Boolean][4]** Whether or not to update
27
27
profile when logging in. (default: `true`)
28
-
-`config.resetBeforeLogin`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to empty profile
28
+
-`config.resetBeforeLogin`**[Boolean][4]** Whether or not to empty profile
29
29
and auth state on login
30
-
-`config.perserveOnLogout`**([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\|[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** Data parameters to perserve
30
+
-`config.perserveOnLogout`**([Object][2]\|[Array][6])** Data parameters to perserve
31
31
when logging out. If Array is passed, each item represents keys
32
32
within `state.firebase.data` to preserve. If an object is passed,
33
33
keys associate with slices of state to preserve, and the values can be either
@@ -39,27 +39,27 @@ along side applyMiddleware.
39
39
whatever is returned from the function is set to that slice of state (`auth`).
40
40
associate with which keys to preserve form that section of state.
41
41
(default: `null`)
42
-
-`config.preserveOnEmptyAuthChange`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**`null` Data parameters to
42
+
-`config.preserveOnEmptyAuthChange`**[Object][2]**`null` Data parameters to
43
43
preserve when logging out. Keys associate with parts of state to preserve,
44
44
and the values are Arrays contain keys for keys within that slice of state
45
45
to preserve.
46
-
-`config.enableRedirectHandling`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable
46
+
-`config.enableRedirectHandling`**[Boolean][4]** Whether or not to enable
-`config.onAuthStateChanged`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Function run when auth state
48
+
-`config.onAuthStateChanged`**[Function][5]** Function run when auth state
-`config.onRedirectResult`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Function run when redirect
50
+
-`config.onRedirectResult`**[Function][5]** Function run when redirect
51
51
result is returned. Argument Pattern: `(authData, firebase, dispatch)`
52
-
-`config.customAuthParameters`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object for setting which
52
+
-`config.customAuthParameters`**[Object][2]** Object for setting which
53
53
customAuthParameters are passed to external auth providers.
54
-
-`config.profileFactory`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying how user profile is saved.
55
-
-`config.fileMetadataFactory`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying
54
+
-`config.profileFactory`**[Function][5]** Factory for modifying how user profile is saved.
55
+
-`config.fileMetadataFactory`**[Function][5]** Factory for modifying
56
56
how file meta data is written during file uploads
57
-
-`config.profileParamsToPopulate`**([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\|[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** Parameters within
57
+
-`config.profileParamsToPopulate`**([Array][6]\|[String][3])** Parameters within
58
58
profile object to populate. As of `v2.0.0` data is only loaded for population, not actually automatically populated
59
59
(allows access to both unpopulated and populated profile data).
60
-
-`config.autoPopulateProfile`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)****NOTE**: Now enabled for v2.0.0. Whether or not to
60
+
-`config.autoPopulateProfile`**[Boolean][4]****NOTE**: Now enabled for v2.0.0. Whether or not to
61
61
automatically populate profile with data loaded through profileParamsToPopulate config. (default: `true`)
62
-
-`config.setProfilePopulateResults`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to
62
+
-`config.setProfilePopulateResults`**[Boolean][4]** Whether or not to
63
63
call SET actions for data that results from populating profile to redux under
64
64
the data path. For example role parameter on profile populated from 'roles'
65
65
root. True will call SET_PROFILE as well as a SET action with the role that
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** That accepts a component and returns a Component which
97
+
Returns **[Function][5]** That accepts a component and returns a Component which
98
98
wraps the provided component (higher order component).
0 commit comments