-
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* `reloadAuth` added for reloading auth (calls `firebase.auth().currentUser.reload()`) - #273 * `linkWithCredential` added for linking auth with credential - #268 * `store.firebaseAuthIsReady` is now added by `reactReduxFirebase` store enhancer - promise that resolves once auth state is ready - #264 * `authIsReady` promise added for waiting for auth to be ready - #264 * `ordered` always set as `null` instead of `undefined` - fixes possible issue of `isLoaded` not always being correct * `firebaseStateName` constant - assumed name of firebase state to be used in `authIsReady` * `attachAuthIsLoaded` constant - boolean for enabling/disabling the attaching of `firebaseAuthIsReady` to store (`true` by default) * `yarn.lock` removed - npm5 is faster * `v2.0.0` branch added to travis config (so v2.0.0 pushes/merges are built) * `babel-preset-env` used in place of `babel-preset-es2015` (fixes deprecation warning)
- Loading branch information
1 parent
c1c98be
commit 9a32d8c
Showing
63 changed files
with
27,091 additions
and
7,680 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
sudo: false | ||
|
||
language: node_js | ||
|
||
node_js: | ||
- "6" | ||
- "8" | ||
- 6.11.3 # L.T.S | ||
- 8 # Current | ||
|
||
sudo: false | ||
notifications: | ||
# Only send notifications when travis status changes | ||
email: | ||
on_failure: change | ||
on_success: change | ||
|
||
addons: | ||
code_climate: | ||
repo_token: $CODE_CLIMATE | ||
|
||
cache: | ||
directories: | ||
- node_modules | ||
|
||
branches: | ||
only: | ||
- master | ||
- v2.0.0 | ||
|
||
script: | ||
- npm run lint:fix | ||
- npm run test:cov | ||
|
||
cache: | ||
yarn: true | ||
directories: | ||
- node_modules | ||
|
||
addons: | ||
code_climate: | ||
repo_token: $CODE_CLIMATE | ||
|
||
after_success: | ||
- npm install -g codeclimate-test-reporter | ||
- codeclimate-test-reporter < coverage/lcov.info | ||
- npm run codecov | ||
|
||
notifications: | ||
email: | ||
# Only send notifications when travis status changes | ||
on_failure: change | ||
on_success: change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
### Table of Contents | ||
|
||
- [reactReduxFirebase](#reactreduxfirebase) | ||
|
||
## reactReduxFirebase | ||
|
||
Redux store enhancer that accepts configuration options and adds | ||
store.firebase and store.firebaseAuth. Enhancers are most commonly placed in redux's `compose` call | ||
along side applyMiddleware. | ||
|
||
**Parameters** | ||
|
||
- `instance` | ||
- `otherConfig` | ||
|
||
**Properties** | ||
|
||
- `firebaseInstance` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Initiated firebase instance (can also | ||
be library following Firebase JS API such as `react-native-firebase`) | ||
- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Containing react-redux-firebase specific configuration | ||
- `config.userProfile` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Location on firebase to store user profiles | ||
- `config.enableLogging` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable Firebase database logging. | ||
**Note**: Only works if instance has enableLogging function. | ||
- `config.profileFactory` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying how user profile is saved. | ||
- `config.presence` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Location on Firebase to store currently | ||
online users list. Often set to `'presence'` or `'onlineUsers'`. | ||
- `config.sessions` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Location on Firebase where user | ||
sessions are stored (only if presense is set). Often set to `'sessions'` or `'onlineUsers'`. | ||
- `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`) | ||
- `config.resetBeforeLogin` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to empty profile | ||
and auth state on login | ||
- `config.enableRedirectHandling` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable | ||
auth redirect handling listener. (default: `true`) | ||
- `config.onAuthStateChanged` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function run when auth state | ||
changes. Argument Pattern: `(authData, firebase, dispatch)` | ||
- `config.enableEmptyAuthChanges` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable | ||
empty auth changes. When set to true, `onAuthStateChanged` will be fired with, | ||
empty auth changes such as undefined on initialization. See | ||
[#137](https://github.com/prescottprue/react-redux-firebase/issues/137) for | ||
more details. (default: `false`) | ||
- `config.onRedirectResult` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function run when redirect | ||
result is returned. Argument Pattern: `(authData, firebase, dispatch)` | ||
- `config.customAuthParameters` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object for setting which | ||
customAuthParameters are passed to external auth providers. | ||
- `config.profileFactory` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying how user profile is saved. | ||
- `config.fileMetadataFactory` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Factory for modifying | ||
how file meta data is written during file uploads | ||
- `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 | ||
profile object to populate. As of `v2.0.0` data is only loaded for population, not actually automatically populated | ||
(allows access to both unpopulated and populated profile data). | ||
- `config.autoPopulateProfile` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** **NOTE**: Not yet enabled for v2.0.0. Whether or not to | ||
automatically populate profile with data loaded through profileParamsToPopulate config. (default: `true`) | ||
- `config.setProfilePopulateResults` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to | ||
call SET actions for data that results from populating profile to redux under | ||
the data path. For example role parameter on profile populated from 'roles' | ||
root. True will call SET_PROFILE as well as a SET action with the role that | ||
is loaded (places it in data/roles). (default: `false`) | ||
|
||
**Examples** | ||
|
||
_Setup_ | ||
|
||
```javascript | ||
import { createStore, compose } from 'redux' | ||
import { reactReduxFirebase } from 'react-redux-firebase' | ||
import * as firebase from 'firebase' | ||
|
||
// React Redux Firebase Config | ||
const config = { | ||
userProfile: 'users', // saves user profiles to '/users' on Firebase | ||
// here is where you place other config options | ||
} | ||
|
||
// initialize script from Firebase page | ||
const fbConfg = {} // firebase config object | ||
firebase.initializeApp(fbConfig) | ||
|
||
// Add react-redux-firebase to compose | ||
// Note: In full projects this will often be within createStore.js or store.js | ||
const createStoreWithFirebase = compose( | ||
reactReduxFirebase(firebase, config), | ||
)(createStore) | ||
|
||
// Use Function later to create store | ||
const store = createStoreWithFirebase(rootReducer, initialState) | ||
``` | ||
|
||
Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** That accepts a component and returns a Component which | ||
wraps the provided component (higher order component). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.