Skip to content

Commit c8547a6

Browse files
prescottprueScott Prue
authored andcommitted
v2.0.0 alpha (#162)
* Basic Population working with new syntax (`populate`) * Material example uses new syntax (no helpers) * A firebase instance can be passed (pass Firebase instance as first argument for `reactReduxFirebase` when creating store) * Unused helpers removed (`populatedDataToJS`, `dataToJS`, `customToJS`)
1 parent c7c6779 commit c8547a6

File tree

76 files changed

+2496
-1590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2496
-1590
lines changed

.eslintrc

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
{
2-
"parser" : "babel-eslint",
3-
"extends" : [
4-
"standard",
5-
"standard-react"
6-
],
7-
"plugins": [
8-
"babel"
9-
],
10-
"env" : {
11-
"browser" : true
12-
},
13-
"globals" : {
14-
"__DEV__" : false,
15-
"__PROD__" : false,
16-
"__DEBUG__" : false,
17-
"__COVERAGE__" : false,
18-
"__BASENAME__" : false
19-
},
20-
"rules": {
21-
"semi" : [2, "never"],
22-
"no-console": "error"
23-
}
24-
}
1+
root: true
2+
3+
parser: babel-eslint
4+
5+
extends: [standard, standard-react]
6+
plugins: [babel, react]
7+
8+
env:
9+
browser: true
10+
es6: true
11+
jasmine: true
12+
node: true
13+
14+
ecmaFeatures:
15+
jsx: true
16+
modules: true
17+
18+
globals:
19+
MockFirebase: true
20+
sinon: true
21+
Raven: true
22+
__COVERAGE__: true
23+
__DEV__: true
24+
25+
rules:
26+
semi: [2, 'never']
27+
no-console: 'error'

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
docs
2+
bin
3+
tests
4+
examples
5+
coverage
6+
_book

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![Code Style][code-style-image]][code-style-url]
1010

1111
[![Gitter][gitter-image]][gitter-url]
12-
[<img src="http://npm.packagequality.com/badge/react-redux-firebase.png" align="right"/>](http://packagequality.com/#?package=react-redux-firebase)
12+
[<img src="http://npm.packagequality.com/badge/react-redux-firebase.png" align="right"/>](https://packagequality.com/#?package=react-redux-firebase)
1313

1414
> Redux bindings for Firebase. Includes Higher Order Component (HOC) for use with React.
1515
@@ -110,7 +110,8 @@ const store = createStoreWithFirebase(rootReducer, initialState)
110110

111111
In components:
112112
```javascript
113-
import React, { Component, PropTypes } from 'react'
113+
import React, { Component } from 'react'
114+
import PropTypes from 'prop-types'
114115
import { connect } from 'react-redux'
115116
import {
116117
firebaseConnect,

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [Populate](/docs/recipes/populate.md)
1717
* [Upload](/docs/recipes/upload.md)
1818
* [Redux Form](/docs/recipes/redux-form.md)
19+
* [Redux Persist](/docs/recipes/redux-persist.md)
1920
* [React Native](/docs/recipes/react-native.md)
2021
* [Server Side Rendering](/docs/recipes/ssr.md)
2122
* [API Reference](/docs/api/README.md)

book.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"gitbook": ">=3.2.1",
33
"title": "React Redux Firebase",
4-
"plugins": ["edit-link", "prism", "-highlight", "github", "anchorjs"],
4+
"plugins": ["edit-link", "prism", "-highlight", "github", "anchorjs", "versions"],
55
"pluginsConfig": {
66
"edit-link": {
77
"base": "https://github.com/prescottprue/react-redux-firebase/tree/master",
@@ -14,6 +14,20 @@
1414
"styles": {
1515
"website": "build/gitbook.css"
1616
}
17+
},
18+
"versions": {
19+
"gitbookConfigURL": "https://raw.githubusercontent.com/prescottprue/react-redux-firebase/master/book.json",
20+
"options": [
21+
{
22+
"value": "https://storage.googleapis.com/react-redux-firebase-13cdb.appspot.com/docs/history/v1.4.0/index.html",
23+
"text": "Version 1.4.0",
24+
"selected": true
25+
},
26+
{
27+
"value": "https://storage.googleapis.com/react-redux-firebase-13cdb.appspot.com/docs/history/v2.0.0/index.html",
28+
"text": "Version 2.0.0"
29+
}
30+
]
1731
}
1832
}
1933
}

docs/api/compose.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ Middleware that handles configuration (placed in redux's
4040
auth redirect handling listener. (default: `true`)
4141
- `config.onAuthStateChanged` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function run when auth state
4242
changes. Argument Pattern: `(authData, firebase, dispatch)`
43+
- `config.enableEmptyAuthChanges` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable
44+
empty auth changes. When set to true, `onAuthStateChanged` will be fired with,
45+
empty auth changes such as undefined on initialization. See
46+
[#137](https://github.com/prescottprue/react-redux-firebase/issues/137) for
47+
more details. (default: `false`)
4348
- `config.onRedirectResult` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function run when redirect
4449
result is returned. Argument Pattern: `(authData, firebase, dispatch)`
4550
- `config.customAuthParameters` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object for setting which
4651
customAuthParameters are passed to external auth providers.
47-
- `config.profileFactory` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying how user profile is saved.
52+
- `config.profileFactory` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying how user
53+
profile is saved.
4854
- `config.uploadFileDataFactory` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying
4955
how file meta data is written during file uploads
5056
- `config.profileParamsToPopulate` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** Parameters within

docs/api/constants.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
1-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2-
3-
### Table of Contents
4-
5-
- [actionsPrefix](#actionsprefix)
6-
- [actionTypes](#actiontypes)
7-
8-
## actionsPrefix
1+
# actionsPrefix
92

103
Prefix for all actions within library
114

12-
Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
13-
145
**Examples**
156

167
```javascript
178
import { constants } from 'react-redux-firebase'
189
constants.actionsPrefix === '@@reactReduxFirebase' // true
1910
```
2011

21-
## actionTypes
12+
# actionTypes
2213

2314
Object containing all action types
2415

2516
**Properties**
2617

2718
- `START` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/START`
2819
- `SET` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/SET`
20+
- `SET_ORDERED` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/SET_ORDERED`
2921
- `SET_PROFILE` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/SET_PROFILE`
3022
- `LOGIN` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/LOGIN`
3123
- `LOGOUT` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/LOGOUT`
@@ -42,6 +34,15 @@ Object containing all action types
4234
- `FILE_DELETE_START` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/FILE_DELETE_START`
4335
- `FILE_DELETE_ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/FILE_DELETE_ERROR`
4436
- `FILE_DELETE_COMPLETE` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/FILE_DELETE_COMPLETE`
37+
- `AUTH_UPDATE_START` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/AUTH_UPDATE_START`
38+
- `AUTH_UPDATE_ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/AUTH_UPDATE_ERROR`
39+
- `AUTH_UPDATE_COMPLETE` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/AUTH_UPDATE_COMPLETE`
40+
- `PROFILE_UPDATE_START` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/PROFILE_UPDATE_START`
41+
- `PROFILE_UPDATE_ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/PROFILE_UPDATE_ERROR`
42+
- `PROFILE_UPDATE_COMPLETE` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/PROFILE_UPDATE_COMPLETE`
43+
- `EMAIL_UPDATE_START` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/EMAIL_UPDATE_START`
44+
- `EMAIL_UPDATE_ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/EMAIL_UPDATE_ERROR`
45+
- `EMAIL_UPDATE_COMPLETE` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/EMAIL_UPDATE_COMPLETE`
4546

4647
**Examples**
4748

@@ -50,7 +51,7 @@ import { actionTypes } from 'react-redux-firebase'
5051
actionTypes.SET === '@@reactReduxFirebase/SET' // true
5152
```
5253

53-
##
54+
# defaultConfig
5455

5556
Default configuration options
5657

@@ -65,6 +66,11 @@ Default configuration options
6566
- `enableRedirectHandling` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to enable
6667
redirect handling. This must be disabled if environment is not http/https
6768
such as with react-native.
69+
- `enableEmptyAuthChanges` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Whether or not to enable
70+
empty auth changes. When set to true, `onAuthStateChanged` will be fired with,
71+
empty auth changes such as `undefined` on initialization
72+
(see [#137](https://github.com/prescottprue/react-redux-firebase/issues/137)).
73+
Requires `v1.5.0-alpha` or higher.
6874
- `autoPopulateProfile` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to
6975
automatically populate profile with data loaded through
7076
profileParamsToPopulate config.
@@ -73,7 +79,7 @@ Default configuration options
7379
the data path. For example: role paramter on profile populated from 'roles'
7480
root. True will call SET_PROFILE as well as a SET action with the role that
7581
is loaded (places it in data/roles).
76-
- `distpatchOnUnsetListener` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Whether or not to
82+
- `dispatchOnUnsetListener` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Whether or not to
7783
dispatch UNSET_LISTENER when disabling listeners for a specific path. USE WITH CAUTION
7884
Setting this to true allows an action to be called that removes data
7985
from redux (which might not always be expected).

0 commit comments

Comments
 (0)