function authIsReady(store, stateName = 'firebase') {
  return new Promise((resolve) => {
    if (isAuthReady(store, stateName)) {
      resolve()
    } else {
      const unsubscribe = store.subscribe(() => {
        if (isAuthReady(store, stateName)) {
          unsubscribe()
          resolve()
        }
      })
    }
  })
}
Returns a promise that completes when Firebase Auth is ready in the given
store using react-redux-firebase.
@param {object} store - The Redux store on which we want to detect if
Firebase auth is ready.
@param {string} [stateName='firebase'] - The attribute name of the react-redux-firebase
reducer when using multiple combined reducers. 'firebase' by default. Set
this to `null` to indicate that the react-redux-firebase reducer is not in a
combined reducer.
@returns {Promise} Resolve when Firebase auth is ready in the store.