gitwtfhub

wtf is flux-standard-action?

redux-utilities/flux-standard-action — explained in plain English

Analysis updated 2026-06-26

4,718JavaScriptAudience · developerComplexity · 1/5Setup · easy

TL;DR

A minimal spec and tiny JavaScript utility that defines a consistent shape for action objects in Redux and Flux apps, so tools and libraries can work together across projects without incompatible formats.

Mindmap

mindmap
  root((flux-standard-action))
    Spec fields
      type required
      payload optional
      error flag
      meta optional
    Utilities
      isFSA check
      isError check
    Use cases
      Redux apps
      Flux apps
      Shared tooling
    Audience
      Frontend developers
      Redux users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Enforce a shared action format across a Redux codebase so every developer and middleware expects the same object shape.

REASON 2

Use the isFSA() utility to validate that actions flowing through middleware are correctly formed before processing them.

REASON 3

Represent both success and failure with one action type by toggling the error flag, instead of creating separate action type names.

What's in the stack?

JavaScriptnpm

How it stacks up

redux-utilities/flux-standard-actionsamyk/evercookiejsonresume/resume-cli
Stars4,7184,7204,714
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasymoderateeasy
Complexity1/53/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Wtf does this do

Flux Standard Action (FSA) is a specification that defines a consistent shape for action objects in JavaScript applications that use Flux or Redux for state management. In those patterns, an "action" is a plain JavaScript object that signals something has happened in the app, like a user submitting a form, and the rest of the system reacts to it. Without a shared convention, different libraries and codebases define these objects in incompatible ways, making it hard to build tools that work across projects. The spec is intentionally minimal. A compliant action must be a plain JavaScript object with a type field that identifies what kind of event occurred. It may optionally have a payload field for the data associated with the event, an error field set to true when the action represents a failure, and a meta field for any extra information that does not belong in the payload. No other fields are allowed. Treating errors as a first-class concept is a core motivation for the spec. Rather than creating separate action types for success and failure cases (like LOAD_SUCCESS and LOAD_FAILURE), FSA allows a single action type to carry an error flag, keeping the action type focused solely on identifying what happened rather than mixing in status information. The repository also ships a small npm package called flux-standard-action with two utility functions: isFSA(action) checks whether a given object conforms to the spec, and isError(action) checks whether an action represents an error. The README lists several compatible libraries, including redux-actions, redux-promise, and redux-rx, which are built to work with FSA-shaped actions.

Yoink these prompts

Prompt 1
I'm building a Redux app. Show me how to structure a fetch-user action as a Flux Standard Action, including both the success and error cases.
Prompt 2
Using the flux-standard-action package, write a middleware that validates every dispatched action with isFSA() and logs a warning if it fails.
Prompt 3
Refactor these two Redux action creators to conform to the FSA spec: one for login success and one for login failure.
Prompt 4
Explain the difference between putting error info in the payload vs setting the error flag to true in an FSA action.

Frequently asked questions

wtf is flux-standard-action?

A minimal spec and tiny JavaScript utility that defines a consistent shape for action objects in Redux and Flux apps, so tools and libraries can work together across projects without incompatible formats.

What language is flux-standard-action written in?

Mainly JavaScript. The stack also includes JavaScript, npm.

How hard is flux-standard-action to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is flux-standard-action for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.