Skip to content

Commit d65aa2f

Browse files
authored
Version v1.4.0-beta (prescottprue#97)
### Breaking Changes * react-native is now used differently in config when creating store which breaks `v1.4.0-alpha` ("rn" was not as clear as "ReactNative"). Use the following config when creating store: ```js import { reactReduxFirebase } from 'react-redux-firebase' import { AsyncStorage } from 'react-native' const fbConfig = {} // your firebase config object reactReduxFirebase(fbConfig, { ReactNative: { AsyncStorage } // now under "ReactNative" instead of "rn" // enableRedirectHandling: false // no longer needed }) ``` * firebase library imported using `import * as firebase from 'firebase'` instead of piece by piece to fix Unsupported Browser error from `v1.4.0-alpha` (thanks @kudorori - full details in prescottprue#87). Could have impact on prescottprue#52, prescottprue#72, or prescottprue#80. ### Features * [react-native complete example](https://github.com/prescottprue/react-redux-firebase/tree/v1.4.0-beta/examples/complete/react-native) added showing authentication * firebase library updated to `v3.7.3` * Package quality image added to README * Docs updated with react-native changes
1 parent cc0ad58 commit d65aa2f

File tree

17 files changed

+6699
-72
lines changed

17 files changed

+6699
-72
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ script:
1414
- npm run test:cov
1515

1616
cache:
17+
yarn: true
1718
directories:
1819
- node_modules
1920

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# react-redux-firebase
22

3-
[![Gitter][gitter-image]][gitter-url]
4-
53
[![NPM version][npm-image]][npm-url]
64
[![NPM downloads][npm-downloads-image]][npm-url]
75
[![Build Status][travis-image]][travis-url]
@@ -10,6 +8,9 @@
108
[![Code Coverage][coverage-image]][coverage-url]
119
[![Code Style][code-style-image]][code-style-url]
1210

11+
[![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)
13+
1314
> Redux bindings for Firebase. Includes Higher Order Component (HOC) for use with React.
1415
1516
## [Demo](https://demo.react-redux-firebase.com)

SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* [constants](/docs/api/constants.md)
2121
* [firebaseConnect](/docs/api/connect.md)
2222
* [firebaseStateReducer](/docs/api/reducer.md)
23+
* [props.firebase](/docs/api/props-firebase.md)
24+
* [getFirebase](/docs/api/get-firebase.md)
2325
* [reactReduxFirebase](/docs/api/compose.md)
2426
* [helpers](/docs/api/helpers.md)
2527
* [Roadmap](/docs/roadmap.md)

docs/api/compose.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -59,44 +59,3 @@ const store = createStoreWithFirebase(rootReducer, initialState)
5959
```
6060

6161
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
62-
63-
# getFirebase
64-
65-
Expose Firebase instance created internally. Useful for
66-
integrations into external libraries such as redux-thunk and redux-observable.
67-
68-
**Examples**
69-
70-
_redux-thunk integration_
71-
72-
```javascript
73-
import { applyMiddleware, compose, createStore } from 'redux';
74-
import thunk from 'redux-thunk';
75-
import { reactReduxFirebase } from 'react-redux-firebase';
76-
import makeRootReducer from './reducers';
77-
import { getFirebase } from 'react-redux-firebase';
78-
79-
const fbConfig = {} // your firebase config
80-
81-
const store = createStore(
82-
makeRootReducer(),
83-
initialState,
84-
compose(
85-
applyMiddleware([
86-
// Pass getFirebase function as extra argument
87-
thunk.withExtraArgument(getFirebase)
88-
]),
89-
reactReduxFirebase(fbConfig)
90-
)
91-
);
92-
// then later
93-
export const addTodo = (newTodo) =>
94-
(dispatch, getState, getFirebase) => {
95-
const firebase = getFirebase()
96-
firebase
97-
.push('todos', newTodo)
98-
.then(() => {
99-
dispatch({ type: 'SOME_ACTION' })
100-
})
101-
};
102-
```

docs/api/get-firebase.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# getFirebase
2+
3+
Expose Firebase instance created internally, which is the same as [props.firebase](/docs/api/props-firebase.md). Useful for
4+
integrations into external libraries such as redux-thunk and redux-observable.
5+
6+
**Examples**
7+
8+
_redux-thunk integration_
9+
10+
```javascript
11+
import { applyMiddleware, compose, createStore } from 'redux';
12+
import thunk from 'redux-thunk';
13+
import { reactReduxFirebase } from 'react-redux-firebase';
14+
import makeRootReducer from './reducers';
15+
import { getFirebase } from 'react-redux-firebase';
16+
17+
const fbConfig = {} // your firebase config
18+
19+
const store = createStore(
20+
makeRootReducer(),
21+
initialState,
22+
compose(
23+
applyMiddleware([
24+
// Pass getFirebase function as extra argument
25+
thunk.withExtraArgument(getFirebase)
26+
]),
27+
reactReduxFirebase(fbConfig)
28+
)
29+
);
30+
// then later
31+
export const addTodo = (newTodo) =>
32+
(dispatch, getState, getFirebase) => {
33+
const firebase = getFirebase()
34+
firebase
35+
.push('todos', newTodo)
36+
.then(() => {
37+
dispatch({ type: 'SOME_ACTION' })
38+
})
39+
};
40+
```

0 commit comments

Comments
 (0)