function spinnerWhileLoading(propNames) {
  if (!propNames || !Array.isArray(propNames)) {
    const missingPropNamesErrMsg =
      'spinnerWhileLoading requires propNames array'
    console.error(missingPropNamesErrMsg) // eslint-disable-line no-console
    throw new Error(missingPropNamesErrMsg)
  }
  return spinnerWhile(props =>
    propNames.some(name => !isLoaded(get(props, name)))
  )
}
Show a loading spinner while props are loading . Checks
for undefined, null, or a value (as well as handling `auth.isLoaded` and
`profile.isLoaded`). **NOTE:** Meant to be used with props which are passed
as props from state.firebase using connect (from react-redux), which means
it could have unexpected results for other props
@param {Array} propNames - List of prop names to check loading for
@returns {HigherOrderComponent}
@example <caption>Spinner While Data Loading</caption>
import { compose } from 'redux'
import { connect } from 'react-redux'
import { firebaseConnect } from 'react-redux-firebase'

const enhance = compose(
  firebaseConnect(() => ['projects']),
  connect(({ firebase: { data: { projects } } }) => ({ projects })),
  spinnerWhileLoading(['projects'])
)

export default enhance(SomeComponent)