Version v2.0.0 Alpha
Pre-release
Pre-release
- 🎉 NO MORE IMMUTABLE.JS! 🎉 which means:
- no more using
pathToJS
,dataToJS
, orcustomToJS
- see snippets below - simplified population (can easily be done manually following common redux patterns)
redux-persist
is supported out of the box (no longer needdataToJS
,pathToJS
, orcustomToJS
)
- no more using
- New Population syntax (
populate
instead ofpopulatedDataToJS
) - see snippets below - Firebase instance can be passed as first argument instead of config vars (see snippets below):
- removes platform specific code while improving platform support
- allows any version of Firebase to be used
- allows
react-native-firebase
to be passed (for using native modules instead of JS withinreact-native
)
- Wrapping instance with helpers which internally dispatch redux actions separated into exported function named
createFirebaseInstance
- Material example uses new syntax (no helpers)
- react-native example passes in an instantiated instance of Firebase
Migration Guide
Syntax Snippets
-
No more helpers:
import { connect } from 'react-redux' import { firebaseConnect } from 'react-redux-firebase'; @firebaseConnect(['todos']) @connect( ({ firebase: { auth, data: { todos }} }) => ({ todos, // v1 would require dataToJS auth, // v1 would require pathToJS }) )
-
Passing A Firebase Instance:
import * as firebase from 'firebase/app' import 'firebase/auth' import 'firebase/database' import 'firebase/storage' const fbConfig = {} // object containing Firebase config firebase.initializeApp(fbConfig) const store = createStore( reducer, initialState, compose( reactReduxFirebase(firebase, reduxConfig), applyMiddleware(...middleware), ...enhancers ) )
-
new populate syntax:
import { connect } from 'react-redux' import { firebaseConnect, populate } from 'react-redux-firebase' const populates = [ { child: 'owner', root: 'users' } ] @firebaseConnect([ { path: 'todos', populates } // '/todos#populate=owner:users', // equivalent string notation ]) @connect( ({ firebase }) => ({ todos: populate(firebase, 'todos', populates), // used to be populatedDataToJS }) )