function getFirebase() {
  /* istanbul ignore next: Firebase instance always exists during tests */
  if (!firebaseInstance) {
    throw new Error(
      'Firebase instance does not yet exist. Check your compose function.'
    ) // eslint-disable-line no-console
  }
  return firebaseInstance
}
Get internal Firebase instance with methods which are wrapped with action dispatches. Useful for
integrations into external libraries such as redux-thunk and redux-observable.
@returns {object} Firebase instance with methods which dispatch redux actions
@see http://react-redux-firebase.com/api/getFirebase.html
@example <caption>redux-thunk integration</caption>
import { applyMiddleware, compose, createStore } from 'redux';
import thunk from 'redux-thunk';
import { getFirebase } from 'react-redux-firebase';
import makeRootReducer from './reducers';

const fbConfig = {} // your firebase config

const store = createStore(
  makeRootReducer(),
  initialState,
  compose(
    applyMiddleware([
      // Pass getFirebase function as extra argument
      thunk.withExtraArgument(getFirebase)
    ])
  )
);
// then later
export function addTodo(newTodo) {
  return (dispatch, getState, getFirebase) => {
    const firebase = getFirebase()
    firebase
      .push('todos', newTodo)
      .then(() => {
        dispatch({ type: 'SOME_ACTION' })
      })
  }
}