Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

redux-actions

> 编程语言
Open source

Flux Standard Action utilities for Redux.

6.5K stars0 likes5 views
WebsiteGitHub

About

Flux Standard Action utilities for Redux.

redux-actions

Flux Standard Action utilities for Redux

Table of Contents

  • Getting Started
    • Installation
    • Usage
  • Documentation

Getting Started

Installation

bash
$ npm install --save redux-actions

or

bash
$ yarn add redux-actions

The npm package provides ES modules that should be compatible with every modern build tooling.

Usage

javascript
import { createActions, handleActions, combineActions } from 'redux-actions';

const defaultState = { counter: 10 };

const { increment, decrement } = createActions({
  INCREMENT: (amount = 1) => ({ amount }),
  DECREMENT: (amount = 1) => ({ amount: -amount })
});

const reducer = handleActions(
  {
    [combineActions(increment, decrement)]: (
      state,
      { payload: { amount } }
    ) => {
      return { ...state, counter: state.counter + amount };
    }
  },
  defaultState
);

export default reducer;

See the full API documentation.

Documentation

  • Introduction
  • API
  • External Resources
  • Changelog
  • Contributors

Issues· 49 open

View all issuesOpen on GitHub
  • #401

    Not working with Jest from v3.0.0 part 2

    Updated Dec 12, 2024
  • #402

    3.0.3 release comes without src folder

    Updated Oct 12, 2024
  • #394

    Compilation error in `react-native:0.71.8`

    Updated Oct 12, 2023
  • #393

    Not Working with React Native from v.3.0.0

    Updated Jun 19, 2023
  • #392

    can redux-actions be used with redux-thunk?

    questionUpdated May 17, 2023
  • #328

    Add support for uppercased action type name in createActions returned action map?

    Updated May 25, 2020
  • #345

    [Feature request] Function value for defaultState

    Updated May 25, 2020
  • #347

    can't use Map on handleActions

    Updated May 23, 2020
  • #350

    Error handling on action payload

    Updated May 15, 2020
  • #329

    Use immer within redux-actions

    Updated Mar 27, 2020

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言