How to use the react-redux-firebase.isEmpty function in react-redux-firebase

To help you get started, we’ve selected a few react-redux-firebase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prescottprue / redux-firestore / examples / complete / src / containers / Navbar / Navbar.enhancer.js View on Github external
withProps(({ auth, profile }) => ({
    authExists: isLoaded(auth) && !isEmpty(auth)
  })),
  // Flatten profile so that avatarUrl and displayName are props
github mapswipe / mapswipe / src / shared / views / RecommendedCards.js View on Github external
render() {
        const {
            navigation,
            projects,
        } = this.props;
        if (!isLoaded(projects)) {
            return ();
        }
        if (isLoaded(projects) && isEmpty(projects)) {
            return ();
        }

        // since we can't completely filter projects by status AND projectType in firebase
        // we add a filter here to make sure we only display project types that the app can handle
        return (
            
                { this.renderAnnouncement() }
                { projects.filter(
                    p => p.value && p.value.projectType
                    && GLOBAL.SUPPORTED_PROJECT_TYPES.includes(p.value.projectType),
                )
github prescottprue / redux-firestore / examples / complete / src / containers / Navbar / Navbar.js View on Github external
function Navbar() {
  const classes = useStyles()

  // Get auth from redux state
  const auth = useSelector(state => state.firebase.auth)
  const authExists = isLoaded(auth) && !isEmpty(auth)

  return (
    
      {authExists ? (
        
      ) : (
        <button data-test="sign-in">
          Sign In
        </button>
      )}
    
  )
github prescottprue / generator-react-firebase / examples / react-firebase / src / routes / Login / containers / LoginContainer.js View on Github external
<div>
          or
        </div>
        <div>
           this.providerLogin('google')} /&gt;
        </div>
        <div>
          <span>
            Need an account?
          </span>
          
            Sign Up
          
        </div>
        {
          isLoaded(authError) &amp;&amp; !isEmpty(authError) &amp;&amp; snackCanOpen &amp;&amp;
            
        }
      
    )
  }
}
github prescottprue / react-redux-firebase / examples / snippets / decorators / App.js View on Github external
render () {
    const { firebase, todos } = this.props

    const todosList = (!isLoaded(todos))
                        ? 'Loading'
                        : (isEmpty(todos))
                          ? 'Todo list is empty'
                          : map(todos, (todo, id) =&gt; (
                              
                            ))
    return (
      <div>
        <div>
          <h2>react-redux-firebase decorators demo</h2>
        </div>
        <div>
          <h4>Todos List</h4>
          {todosList}
        </div>
      </div>
    )
  }
github transmute-industries / eth-faucet / src / containers / Signup / SignupContainer.js View on Github external
<div>
           this.providerLogin('google')} /&gt;
        </div>
        <div>
          <span>
            Already have an account?
          </span>
          
            Login
          
        </div>
        {
          isLoaded(authError) &amp;&amp; !isEmpty(authError) &amp;&amp; snackCanOpen &amp;&amp;
             this.setState({ snackCanOpen: false })}
            /&gt;
        }
      
    )
  }
}
github prescottprue / react-redux-firebase / examples / complete / material / src / routes / Projects / routes / Project / containers / ProjectContainer.js View on Github external
render() {
    const { project, params } = this.props

    if (isEmpty(project)) {
      return <div>Project not found</div>
    }

    if (!isLoaded(project)) {
      return 
    }

    return (
      <div>
        <h2>Project Container</h2>
        <pre>Project Key: {params.projectname}</pre>
        <pre>{JSON.stringify(project, null, 2)}</pre>
      </div>
    )
  }
}
github prescottprue / generator-react-firebase / examples / react-firebase / src / routes / Signup / containers / SignupContainer.js View on Github external
<div>
          or
        </div>
        <div>
           this.providerLogin('google')} /&gt;
        </div>
        <div>
          <span>
            Already have an account?
          </span>
          
            Login
          
        </div>
        {
          isLoaded(authError) &amp;&amp; !isEmpty(authError) &amp;&amp; snackCanOpen &amp;&amp;
             this.setState({ snackCanOpen: false })}
            /&gt;
        }
      
    )
  }
}
github prescottprue / react-redux-firebase / examples / complete / typescript / src / List.tsx View on Github external
function List() {
  useFirestoreConnect([{
    collection: "todos",
  }]);
  const todos = useSelector((state: SystemState) =&gt; state.firebase.data.todos);
  if (!isLoaded(todos)) { return "Loading..."; }
  if (isEmpty(todos)) { return null; }
  return (
    <ul>
      {todos.map((todo: any) =&gt; (
        <li>{todo.name}</li>
      ))}
    </ul>
  );
}