Redux bindings for Firebase
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/basic Basic example. Middleware added. Oct 4, 2017
src Tests all passing. Oct 13, 2017
tests Correct references for internals Oct 12, 2017
.babelrc Tests running. Oct 12, 2017
.eslintrc Tests running. Oct 12, 2017
.gitignore Initial commit. Logic copied from react-redux-firebase v2. Sep 18, 2017
.istanbul.yml Initial commit. Logic copied from react-redux-firebase v2. Sep 18, 2017
.npmignore Initial commit. Logic copied from react-redux-firebase v2. Sep 18, 2017
.travis.yml Initial commit. Logic copied from react-redux-firebase v2. Sep 18, 2017
LICENSE.md
README.md
index.d.ts Initial commit. Logic copied from react-redux-firebase v2. Sep 18, 2017
package-lock.json Tests running. Oct 12, 2017
package.json
webpack.config.js Basic example. Middleware added. Oct 4, 2017

README.md

redux-firebase

NPM version NPM downloads Quality Code Coverage Code Style License Build Status Dependency Status Backers on Open Collective

Gitter

Redux bindings for Firebase

Why?

Provide Framework/library agnostic Firebase bindings for redux similar to those available in react-redux-firebase and other similar libraries.

Features

  • Integrated into redux
  • Support for updating and nested props
  • Population capability (similar to mongoose's populate or SQL's JOIN)
  • Out of the box support for authentication (with auto load user profile)
  • Firebase Storage Support
  • Support small data ( using value ) or large datasets ( using child_added, child_removed, child_changed )
  • queries support ( orderByChild, orderByKey, orderByValue, orderByPriority, limitToLast, limitToFirst, startAt, endAt, equalTo right now )
  • Automatic binding/unbinding
  • Declarative decorator syntax for React components
  • Tons of integrations including redux-thunk and redux-observable
  • Action Types and other Constants exported for external use (such as in redux-observable)
  • Firebase v3+ support
  • Server Side Rendering Support
  • react-native support using native modules or web sdk

Install

npm install --save redux-firebase

Use

Note: If you are just starting a new project, you may want to use v2.0.0 since it is has an even easier syntax. For clarity on the transition, view the v1 -> v2 migration guide

Include reactReduxFirebase in your store compose function and firebaseStateReducer in your reducers:

import { createStore, combineReducers, compose } from 'redux'
import { reduxFirebase, firebaseReducer } from 'react-redux-firebase'
import * as firebase from 'firebase'

// Add Firebase to reducers
const rootReducer = combineReducers({
  firebase: firebaseReducer
})

// Firebase config
const config = {
  apiKey: '<your-api-key>',
  authDomain: '<your-auth-domain>',
  databaseURL: '<your-database-url>',
  storageBucket: '<your-storage-bucket>'
}
const rfConfig = { userProfile: 'users' } // react-redux-firebase config

// initialize firebase instance
firebase.initializeApp(config) // <- new to v2.*.*

// Add reduxReduxFirebase to compose
const createStoreWithFirebase = compose(
  reduxFirebase(firebase, rfConfig), // firebase instance as first argument
)(createStore)

// Create store with reducers and initial state
const store = createStoreWithFirebase(rootReducer, initialState)

Discussion

Join us on the redux-firebase gitter.

FAQ

  1. How is this different than react-redux-firebase?

The future plan for is for react-redux-firebase to be powered by this library. redux-firebase will contain the redux specific internal logic which was originally created for react-redux-firebase. In this way, redux-firebase is front end framework agnostic,

  1. How do I help?
  • Join the conversion on gitter
  • Post Issues
  • Create Pull Requests