Skip to content

Commit cb79095

Browse files
author
Scott Prue
committed
fix(examples): update firestore example based on recent changes to redux-firestore (v0.4.0 release)
1 parent 11ccb0e commit cb79095

File tree

16 files changed

+2946
-900
lines changed

16 files changed

+2946
-900
lines changed

docs/api/connect.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
### Table of Contents
44

5-
- [createFirebaseConnect](#createfirebaseconnect)
6-
- [firebaseConnect](#firebaseconnect)
5+
- [createFirebaseConnect][1]
6+
- [firebaseConnect][2]
77

88
## createFirebaseConnect
99

@@ -15,7 +15,7 @@ needing to access a firebase instance created under a different store key.
1515

1616
**Parameters**
1717

18-
- `storeKey` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of redux store which contains
18+
- `storeKey` **[String][3]** Name of redux store which contains
1919
Firebase state (state.firebase) (optional, default `'store'`)
2020

2121
**Examples**
@@ -31,7 +31,7 @@ const firebaseConnect = createFirebaseConnect('anotherStore')
3131
export default firebaseConnect()(SomeComponent)
3232
```
3333

34-
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
3535

3636
## firebaseConnect
3737

@@ -42,7 +42,7 @@ to provided firebase paths using React's Lifecycle hooks.
4242

4343
**Parameters**
4444

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
4646
from Firebase. Can also be a function that returns the array. The function
4747
is passed the current props and the firebase object.
4848

@@ -72,7 +72,7 @@ const enhance = compose(
7272
})
7373
)
7474
// use enhnace to pass todos list as props.todos
75-
const Todos = enhance(({ todos }) =>
75+
const Todos = enhance(({ todos })) =>
7676
<div>
7777
{JSON.stringify(todos, null, 2)}
7878
</div>
@@ -123,4 +123,14 @@ export default compose(
123123
)(SomeComponent)
124124
```
125125
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
127+
128+
[1]: #createfirebaseconnect
129+
130+
[2]: #firebaseconnect
131+
132+
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
133+
134+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
135+
136+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

docs/api/constants.md

Lines changed: 88 additions & 66 deletions
Large diffs are not rendered by default.

docs/api/enhancer.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Table of Contents
44

5-
- [reactReduxFirebase](#reactreduxfirebase)
5+
- [reactReduxFirebase][1]
66

77
## reactReduxFirebase
88

@@ -12,22 +12,22 @@ along side applyMiddleware.
1212

1313
**Parameters**
1414

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
1616
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.
2020
**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
2323
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
2525
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
2727
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
2929
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
3131
when logging out. If Array is passed, each item represents keys
3232
within `state.firebase.data` to preserve. If an object is passed,
3333
keys associate with slices of state to preserve, and the values can be either
@@ -39,27 +39,27 @@ along side applyMiddleware.
3939
whatever is returned from the function is set to that slice of state (`auth`).
4040
associate with which keys to preserve form that section of state.
4141
(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
4343
preserve when logging out. Keys associate with parts of state to preserve,
4444
and the values are Arrays contain keys for keys within that slice of state
4545
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
4747
auth redirect handling listener. (default: `true`)
48-
- `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
4949
changes. Argument Pattern: `(authData, firebase, dispatch)`
50-
- `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
5151
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
5353
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
5656
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
5858
profile object to populate. As of `v2.0.0` data is only loaded for population, not actually automatically populated
5959
(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
6161
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
6363
call SET actions for data that results from populating profile to redux under
6464
the data path. For example role parameter on profile populated from 'roles'
6565
root. True will call SET_PROFILE as well as a SET action with the role that
@@ -94,5 +94,17 @@ const createStoreWithFirebase = compose(
9494
const store = createStoreWithFirebase(rootReducer, initialState)
9595
```
9696

97-
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
9898
wraps the provided component (higher order component).
99+
100+
[1]: #reactreduxfirebase
101+
102+
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
103+
104+
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
105+
106+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
107+
108+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
109+
110+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

0 commit comments

Comments
 (0)