Redux

Redux

  • Getting Started
  • API
  • FAQ
  • Github
  • Need help?

›FAQ

Introduction

  • Getting Started with Redux
  • Installation
  • Motivation
  • Core Concepts
  • Three Principles
  • Prior Art
  • Learning Resources
  • Ecosystem
  • Examples

Basic Tutorial

  • Basic Tutorial: Intro
  • Actions
  • Reducers
  • Store
  • Data flow
  • Usage with React
  • Example: Todo List

Advanced Tutorial

  • Advanced Tutorial: Intro
  • Async Actions
  • Async Flow
  • Middleware
  • Usage with React Router
  • Example: Reddit API
  • Next Steps

Recipes

  • Recipes: Index
  • Configuring Your Store
  • Usage With TypeScript
  • Migrating to Redux
  • Using Object Spread Operator
  • Reducing Boilerplate
  • Server Rendering
  • Writing Tests
  • Computing Derived Data
  • Implementing Undo History
  • Isolating Redux Sub-Apps
  • Using Immutable.JS with Redux
  • Code Splitting
  • Structuring Reducers

    • Structuring Reducers: Intro
    • Prerequisite Concepts
    • Basic Reducer Structure
    • Splitting Reducer Logic
    • Refactoring Reducers Example
    • Using combineReducers
    • Beyond combineReducers
    • Normalizing State Shape
    • Updating Normalized Data
    • Reusing Reducer Logic
    • Immutable Update Patterns
    • Initializing State

FAQ

  • FAQ Index
  • General
  • Reducers
  • Organizing State
  • Store Setup
  • Actions
  • Immutable Data
  • Code Structure
  • Performance
  • Design Decisions
  • React Redux
  • Miscellaneous

Other

  • Glossary
  • Troubleshooting
  • Feedback

API Reference

  • API Reference
  • createStore
  • Store
  • combineReducers
  • applyMiddleware
  • bindActionCreators
  • compose

Redux FAQ: Miscellaneous

Table of Contents

  • Are there any larger, “real” Redux projects?
  • How can I implement authentication in Redux?

Miscellaneous

Are there any larger, “real” Redux projects?

Yes, lots of them! To name just a few:

  • Twitter's mobile site
  • Wordpress's new admin page
  • Firefox's new debugger
  • The HyperTerm terminal application

And many, many more! The Redux Addons Catalog has a list of Redux-based applications and examples that points to a variety of actual applications, large and small.

Further information

Documentation

  • Introduction: Examples

Discussions

  • Reddit: Large open source react/redux projects?
  • HN: Is there any huge web application built using Redux?

How can I implement authentication in Redux?

Authentication is essential to any real application. When going about authentication you must keep in mind that nothing changes with how you should organize your application and you should implement authentication in the same way you would any other feature. It is relatively straightforward:

  1. Create action constants for LOGIN_SUCCESS, LOGIN_FAILURE, etc.

  2. Create action creators that take in credentials, a flag that signifies whether authentication succeeded, a token, or an error message as the payload.

  3. Create an async action creator with Redux Thunk middleware or any middleware you see fit to fire a network request to an API that returns a token if the credentials are valid. Then save the token in the local storage or show a response to the user if it failed. You can perform these side effects from the action creators you wrote in the previous step.

  4. Create a reducer that returns the next state for each possible authentication case (LOGIN_SUCCESS, LOGIN_FAILURE, etc).

Further information

Articles

  • Authentication with JWT by Auth0
  • Tips to Handle Authentication in Redux

Examples

  • react-redux-jwt-auth-example

Libraries

  • Redux Addons Catalog: Use Cases - Authentication
Last updated on 12/4/2018
← React ReduxGlossary →
  • Table of Contents
  • Miscellaneous
    • Are there any larger, “real” Redux projects?
    • How can I implement authentication in Redux?
Redux
Docs
Getting StartedCore ConceptsBasicsAdvanced
Community
Stack OverflowDiscord
More
GitHubStar
Copyright (c) 2015-present Dan Abramov and the Redux documentation authors.
Some icons copyright Font Awesome and Noun Project (Hassan ali, ProSymbols)