Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add firestore populate docs
Docs do mention populate is supported in firestore.md, however the how-to was missing.
  • Loading branch information
harveychow authored Jun 3, 2020
commit 33023c82cedf9550fc30049a5e16599b74ef4399
23 changes: 23 additions & 0 deletions docs/populate.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,26 @@ const config = {
}
}
```

### Use with Firestore

To use populate with Firestore, just replace firebaseConnect with firestoreConnect with the corresponding charaters.

```javascript
import { firestoreConnect, populate } from 'react-redux-firebase';

const populates = [
{ child: 'owner', root: 'users', childAlias: 'ownerObj' }
]

const enhance = compose(
firestoreConnect([
{ collection: 'todos', populates }
]),
connect(
({ firebase }) => ({
todos: populate(firebase, 'todos', populates),
})
)
)
```