Skip to content

Commit 482e210

Browse files
author
Scott Prue
committed
Docs/Roadmap updated to reflect recent feature requests + issues.
* Populate section added to recipes * Profile Params list populate added to roadmap to address #24 * firebase-admin support added to roadmap to address #22 * AuthRequired and Loading decorators added to roadmap
1 parent 4c3b1d0 commit 482e210

File tree

8 files changed

+118
-11
lines changed

8 files changed

+118
-11
lines changed

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* [Upload](/docs/recipes/upload.md)
1111
* [Actions](/docs/recipes/actions.md)
1212
* [Thunks](/docs/recipes/thunks.md)
13+
* [Populate](/docs/recipes/populate.md)
1314
* [API Reference](/docs/api/README.md)
1415
* [constants](/docs/api/constants.md)
1516
* [firebaseConnect](/docs/api/connect.md)

docs/api/compose.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Middleware that handles configuration (placed in redux's `compose` call)
1616
- `config.enableLogging` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Location on firebase to store user profiles. default: `false`
1717
- `config.profileDecorator` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Location on firebase to store user profiles. default: `false`
1818
- `config.updateProfileOnLogin` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to update profile when logging in. default: `false`
19-
- `config.profileParamsToPopulate` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to update profile when logging in. default: `false`
19+
- `config.profileParamsToPopulate` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Parameters within profile object to populate
2020

2121
**Examples**
2222

@@ -48,4 +48,4 @@ const createStoreWithFirebase = compose(
4848
const store = createStoreWithFirebase(rootReducer, initialState)
4949
```
5050

51-
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
51+
Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Middleware function

docs/auth.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ this.props.firebase.login({
9696
```js
9797
// Call with info
9898
this.props.firebase.login({
99-
provider: 'google'
99+
provider: 'google',
100+
type: 'redirect'
100101
})
101102
```
102103

docs/populate.md

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Populate allows you to replace the owner parameter with another value on Firebas
1313
##### Example Data
1414
```javascript
1515
todos: {
16-
123: {
16+
ASDF123: {
1717
text: 'Some Todo Item',
1818
owner: "Iq5b0qK2NtgggT6U3bU6iZRGyma2"
1919
}
@@ -47,7 +47,7 @@ When trying to replace the owner parameter with a string such as a displayName f
4747

4848
##### Result
4949
```javascript
50-
123: {
50+
ASDF123: {
5151
text: 'Some Todo Item',
5252
owner: 'Scott Prue'
5353
}
@@ -67,7 +67,7 @@ Population can also be used to populate a parameter with an object. An example o
6767
##### Example Result
6868

6969
```javascript
70-
123: {
70+
ASDF123: {
7171
text: 'Some Todo Item',
7272
owner: {
7373
displayName: 'Scott Prue',
@@ -96,8 +96,93 @@ There is also the option to load a parameter from within a population object. An
9696
##### Example Result
9797

9898
```javascript
99-
123: {
99+
ASDF123: {
100100
text: 'Some Todo Item',
101101
102102
}
103103
```
104+
105+
## Profile Parameters
106+
**NOTE:** This functionality is still under construction. Please confirm you have the most recent version.
107+
108+
To Populate parameters within profile/user object, include the `profileParamsToPopulate` parameter when [calling `reactReduxFirebase` in your compose function](/api/compose).
109+
110+
### Parameter
111+
112+
##### Example Config
113+
Populating username with username from usernames ref.
114+
115+
```javascript
116+
const config = {
117+
userProfile: 'users',
118+
profileParamsToPopulate: [ 'username:usernames' ]
119+
}
120+
```
121+
##### Initial Data
122+
123+
```javascript
124+
{
125+
users: {
126+
$uid: {
127+
128+
displayName: 'Iq5b0qK2NtgggT6U3bU6iZRGyma2'
129+
}
130+
}
131+
}
132+
```
133+
##### Example Result
134+
135+
```javascript
136+
{
137+
users: {
138+
$uid: {
139+
140+
displayName: 'someuser'
141+
}
142+
}
143+
}
144+
```
145+
146+
### List of Items (Coming Soon)
147+
**Note:** This feature does not currently work, but is being added to `v1.2.0`
148+
149+
##### Example Config
150+
151+
```javascript
152+
const config = {
153+
userProfile: 'users',
154+
profileParamsToPopulate: [ 'todos:todos' ] // populate list of todos from todos ref
155+
}
156+
```
157+
158+
##### Initial Data
159+
160+
```javascript
161+
{
162+
users: {
163+
$uid: {
164+
165+
todos: {
166+
0: "ASDF123"
167+
}
168+
}
169+
}
170+
}
171+
```
172+
173+
##### Example Result
174+
```js
175+
{
176+
users: {
177+
$uid: {
178+
179+
todos: {
180+
ASDF123: {
181+
text: 'Some Todo Item',
182+
owner: "Iq5b0qK2NtgggT6U3bU6iZRGyma2"
183+
}
184+
}
185+
}
186+
}
187+
}
188+
```

docs/recipes/populate.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Populate
2+
3+
### Populate Profile Parameters
4+
5+
To Populate parameters within profile/user object, include the `profileParamsToPopulate` parameter when [calling `reactReduxFirebase` in your compose function](/api/compose).
6+
7+
#### Examples
8+
9+
##### Populate List of Items
10+
11+
```javascript
12+
const config = {
13+
userProfile: 'users',
14+
profileParamsToPopulate: [ 'todos:todos' ] // populate list of todos from todos ref
15+
}
16+
```

docs/roadmap.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Roadmap
22

33
### Short Term
4+
* List Population within user profile parameter (only single parameter currently supported)
5+
* `firebase-admin` integration
46
* Huge App Example with passing of props to child routes
7+
* AuthRequired Decorator (redirect if not logged in)
8+
* Loading Decorator (with custom loading indicator config)
59

610
### Long Term
711
* Improve docs readability (maybe include REPL for editable examples)

examples/complete/material/src/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const firebase = {
22
apiKey: 'AIzaSyCTUERDM-Pchn_UDTsfhVPiwM4TtNIxots',
3-
authDomain: 'react-redux-firebase.firebaseapp.com',
4-
databaseURL: 'https://react-redux-firebase.firebaseio.com'
3+
authDomain: 'redux-firebasev3.firebaseapp.com',
4+
databaseURL: 'https://redux-firebasev3.firebaseio.com'
55
}
66

77
export const fbPaths = {

src/compose.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ let firebaseInstance
1616
* @param {Boolean} config.enableLogging - Location on firebase to store user profiles. default: `false`
1717
* @param {Function} config.profileDecorator - Location on firebase to store user profiles. default: `false`
1818
* @param {Boolean} config.updateProfileOnLogin - Whether or not to update profile when logging in. default: `false`
19-
* @param {Boolean} config.profileParamsToPopulate - Whether or not to update profile when logging in. default: `false`
20-
* @return {Function} That accepts a component a returns a wrapped version of component
19+
* @param {Boolean} config.profileParamsToPopulate - Parameters within profile object to populate
20+
* @return {Function} Middleware function
2121
* @example <caption>Data</caption>
2222
* import { createStore, compose } from 'redux'
2323
* import { reactReduxFirebase } from 'react-redux-firebase'

0 commit comments

Comments
 (0)