# typesafe-actions
**Repository Path**: mirrors_piotrwitek/typesafe-actions
## Basic Information
- **Project Name**: typesafe-actions
- **Description**: Typesafe utilities for "action-creators" in Redux / Flux Architecture
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-09-25
- **Last Updated**: 2026-05-10
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# typesafe-actions
Typesafe utilities designed to reduce types **verbosity**
and **complexity** in Redux Architecture.
_This library is part of the [React & Redux TypeScript Guide](https://github.com/piotrwitek/react-redux-typescript-guide)_ ecosystem :book:
[](https://www.npmjs.com/package/typesafe-actions)
[](https://www.npmjs.com/package/typesafe-actions)
[](https://www.npmjs.com/package/typesafe-actions)
[](https://www.npmjs.com/package/typesafe-actions)
[](https://semaphoreci.com/piotrekwitek/typesafe-actions)
[](https://david-dm.org/piotrwitek/typesafe-actions)
[](https://david-dm.org/piotrwitek/typesafe-actions?type=peer)
[](https://spectrum.chat/typesafe-actions)
_Found it useful? Want more updates?_
[**Show your support by giving a :star:**](https://github.com/piotrwitek/typesafe-actions/stargazers)
### **What's new?**
:tada: _Now updated to support **TypeScript v3.7**_ :tada:
:warning: Library was recently updated to v5 :warning:
*Current API Docs and Tutorial are outdated (from v4), so temporarily please use this issue as [v5.x.x API Docs](https://github.com/piotrwitek/typesafe-actions/issues/143).*
### **Features**
- Easily create completely typesafe [Actions](#action-creators-api) or even [Async Actions](#createasyncaction)
- No boilerplate and completely typesafe [Reducers](#reducer-creators-api)
- Game-changing [Helper Types](#type-helpers-api) for Redux
### **Examples**
- Todo-App playground: [Codesandbox](https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox)
- React, Redux, TypeScript - RealWorld App: [Github](https://github.com/piotrwitek/react-redux-typescript-realworld-app) | [Demo](https://react-redux-typescript-realworld-app.netlify.com/)
### **Goals**
- **Secure and Minimal** - no third-party dependencies, according to `size-snapshot` (Minified: 3.48 KB, Gzipped: 1.03 KB), check also on [bundlephobia](https://bundlephobia.com/result?p=typesafe-actions)
- **Optimized** - distribution packages bundled in 3 different formats (`cjs`, `esm` and `umd`) with separate bundles for dev & prod (same as `react`)
- **Quality** - complete test-suite for an entire API surface containing regular runtime tests and extra type-tests to guarantee **type soundness** and to prevent regressions in the future TypeScript versions
- **Performance** - integrated performance benchmarks to guarantee that the computational complexity of types are in check and there are no slow-downs when your application grow `npm run benchmark:XXX`
---
## Table of Contents
- [Installation](#installation)
- [Tutorial v4 (v5 is WIP #188)](#tutorial-v4-v5-is-wip-188)
- [Constants](#constants)
- [Actions](#actions)
- [1. Basic actions](#1-basic-actions)
- [2. FSA compliant actions](#2-fsa-compliant-actions)
- [3. Custom actions (non-standard use-cases)](#3-custom-actions-non-standard-use-cases)
- [Action Helpers](#action-helpers)
- [Using action-creators instances instead of type-constants](#using-action-creators-instances-instead-of-type-constants)
- [Using regular type-constants](#using-regular-type-constants)
- [Reducers](#reducers)
- [Extending internal types to enable type-free syntax with `createReducer`](#extending-internal-types-to-enable-type-free-syntax-with-createreducer)
- [Using createReducer API with type-free syntax](#using-createreducer-api-with-type-free-syntax)
- [Alternative usage with regular switch reducer](#alternative-usage-with-regular-switch-reducer)
- [Async-Flows](#async-flows)
- [With `redux-observable` epics](#with-redux-observable-epics)
- [With `redux-saga` sagas](#with-redux-saga-sagas)
- [API Docs v4 (v5 is WIP #189)](#api-docs-v4-v5-is-wip-189)
- [Action-Creators API](#action-creators-api)
- [`action`](#action)
- [`createAction`](#createaction)
- [`createStandardAction`](#createstandardaction)
- [`createCustomAction`](#createcustomaction)
- [`createAsyncAction`](#createasyncaction)
- [Reducer-Creators API](#reducer-creators-api)
- [`createReducer`](#createreducer)
- [Action-Helpers API](#action-helpers-api)
- [`getType`](#gettype)
- [`isActionOf`](#isactionof)
- [`isOfType`](#isoftype)
- [Type-Helpers API](#type-helpers-api)
- [`ActionType`](#actiontype)
- [`StateType`](#statetype)
- [Migration Guides](#migration-guides)
- [`v4.x.x` to `v5.x.x`](#v4xx-to-v5xx)
- [`v3.x.x` to `v4.x.x`](#v3xx-to-v4xx)
- [`v2.x.x` to `v3.x.x`](#v2xx-to-v3xx)
- [`v1.x.x` to `v2.x.x`](#v1xx-to-v2xx)
- [Migrating from `redux-actions` to `typesafe-actions`](#migrating-from-redux-actions-to-typesafe-actions)
- [Compatibility Notes](#compatibility-notes)
- [Recipes](#recipes)
- [Restrict Meta type in `action` creator](#restrict-meta-type-in-action-creator)
- [Compare to others](#compare-to-others)
- [`redux-actions`](#redux-actions)
- [Motivation](#motivation)
- [Contributing](#contributing)
- [Funding Issues](#funding-issues)
- [License](#license)