Skip to content

Commit

Permalink
v0.5.3
Browse files Browse the repository at this point in the history
* feat(core): support for v5.0.0 of the Firebase SDK
* fix(query): fix issue preventing some queries when using v5.0.0 of the Firebase SDK (due to breaking change of `docChanges` (now a method instead of parameter) - #98, #99
* feat(tests): unit test added to verify `docChanges` also works as a method (existing tests cover `docChanges` as a parameter)
  • Loading branch information
prescottprue authored May 18, 2018
2 parents 356d114 + c651c6a commit a4ff1fc
Show file tree
Hide file tree
Showing 12 changed files with 676 additions and 1,194 deletions.
669 changes: 201 additions & 468 deletions examples/basic/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"firebase": "^4.12.0",
"firebase": "^5.0.3",
"lodash": "^4.17.10",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-redux": "^5.0.7",
"react-scripts": "1.1.4",
"recompose": "^0.27.0",
"redux": "^4.0.0",
"redux-firestore": "latest"
"redux-firestore": "^0.5.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
8 changes: 8 additions & 0 deletions examples/basic/src/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const fbConfig = {
apiKey: 'AIzaSyCTUERDM-Pchn_UDTsfhVPiwM4TtNIxots',
authDomain: 'redux-firebasev3.firebaseapp.com',
databaseURL: 'https://redux-firebasev3.firebaseio.com',
storageBucket: 'redux-firebasev3.appspot.com',
messagingSenderId: '823357791673',
projectId: 'redux-firebasev3',
}
29 changes: 13 additions & 16 deletions examples/basic/src/createStore.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
import { createStore, compose } from 'redux'
import rootReducer from './reducer'
import { reduxFirestore } from 'redux-firestore'
import firebase from 'firebase'
import firebase from 'firebase/app'
import 'firebase/firestore'
import { fbConfig } from './config'
import rootReducer from './reducer'

const fbConfig = {
apiKey: 'AIzaSyCTUERDM-Pchn_UDTsfhVPiwM4TtNIxots',
authDomain: 'redux-firebasev3.firebaseapp.com',
databaseURL: 'https://redux-firebasev3.firebaseio.com',
storageBucket: 'redux-firebasev3.appspot.com',
messagingSenderId: '823357791673',
projectId: 'redux-firebasev3'
}
// import 'firebase/storage'

firebase.initializeApp(fbConfig)
firebase.firestore()

// Provide timestamp settings to silence warning about deprecation
firebase.firestore().settings({ timestampsInSnapshots: true })

export default function configureStore(initialState, history) {
const enhancers = []

// Dev tools store enhancer
const devToolsExtension = window.devToolsExtension;
if (typeof devToolsExtension === 'function') {
enhancers.push(devToolsExtension());
}

const createStoreWithMiddleware = compose(
reduxFirestore(firebase,
{
userProfile: 'users'
}
),
// Add redux firestore store enhancer
reduxFirestore(firebase),
...enhancers
)(createStore)

const store = createStoreWithMiddleware(rootReducer)

return store
Expand Down
Loading

0 comments on commit a4ff1fc

Please sign in to comment.