Recipes

This section includes some recipes for using react-redux-firebase within real applications.

Profile

Recipes for using/modifying built in profile handling.

Examples

  • Enable User profiles
  • Change Profile Format

Roles and Access Management

Recipes for using roles with permissions. For example: Admin, user, user-paid.

Upload

Actions for uploading files with Firebase storage including uploadFiles and uploadFile as well as direct access to Firebase.storage().

Examples

  • Upload Files
  • Upload a String as a file

Actions

Standard actions for interacting with Firebase including push, set, uniqueSet, update, and remove.

Examples

  • Write data
  • Remove Data
  • Writing key from a push to another location
  • Writing to multiple locations

Thunks

Actions that dispatch other actions and have access to redux state

Examples

  • Async API Calls (REST or Javascript API)
  • Actions based on state (including browser history)
  • Displaying error after invalid write attempt

Epics

Middleware that listens for Actions and dispatches other, often async, actions.

Examples

  • Debounced persisting of user input: Listen for typing actions from redux-form -> call firebase.update()
  • Throttled/Debounced API calls
  • Displaying a system wide error: Listen for error actions -> display error message

Routing

Change location within your application based on Firebase state.

Examples

  • Route Protection (user redirected to /login if not authenticated)
  • Redirect to / if user visits /login when authenticated
  • Show/Hide components based on user profile data such as role: 'admin' or isAdmin: true

results matching ""

    No results matching ""