HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
piotrwitek
typesafe-actions
TypeScript2018–2019
piotrwitek / typesafe-actions

typesafe-actions

Typesafe utilities for "action-creators" in Redux / Flux Architecture

3Distinct people
3Mentions
0Explicit recommenders
2.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Typesafe utilities for "action-creators" in Redux / Flux Architecture

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month3 dated mentions

Observed mentions: 2018-10-27 20:45:39 UTC to 2019-12-09 09:17:10 UTC.

012018-10-01 00:00:00 UTC to 2018-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsOct 20182018-11-01 00:00:00 UTC to 2018-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-12-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2019-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-01 00:00:00 UTC to 2019-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-03-01 00:00:00 UTC to 2019-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-04-01 00:00:00 UTC to 2019-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-05-01 00:00:00 UTC to 2019-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsMay 20192019-06-01 00:00:00 UTC to 2019-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-07-01 00:00:00 UTC to 2019-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-08-01 00:00:00 UTC to 2019-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-09-01 00:00:00 UTC to 2019-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-10-01 00:00:00 UTC to 2019-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-11-01 00:00:00 UTC to 2019-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-12-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsDec 2019

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Oct 20182018-10-01 00:00:00 UTC2018-11-01 00:00:00 UTC101
Nov 20182018-11-01 00:00:00 UTC2018-12-01 00:00:00 UTC000
Dec 20182018-12-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
Jan 20192019-01-01 00:00:00 UTC2019-02-01 00:00:00 UTC000
Feb 20192019-02-01 00:00:00 UTC2019-03-01 00:00:00 UTC000
Mar 20192019-03-01 00:00:00 UTC2019-04-01 00:00:00 UTC000
Apr 20192019-04-01 00:00:00 UTC2019-05-01 00:00:00 UTC000
May 20192019-05-01 00:00:00 UTC2019-06-01 00:00:00 UTC000
Jun 20192019-06-01 00:00:00 UTC2019-07-01 00:00:00 UTC000
Jul 20192019-07-01 00:00:00 UTC2019-08-01 00:00:00 UTC000
Aug 20192019-08-01 00:00:00 UTC2019-09-01 00:00:00 UTC000
Sep 20192019-09-01 00:00:00 UTC2019-10-01 00:00:00 UTC000
Oct 20192019-10-01 00:00:00 UTC2019-11-01 00:00:00 UTC101
Nov 20192019-11-01 00:00:00 UTC2019-12-01 00:00:00 UTC000
Dec 20192019-12-01 00:00:00 UTC2020-01-01 00:00:00 UTC101

What Hacker News says

3 sources
Being OOT and throwing in unpopular opinion: Redux fails in recreating the success of elm architecture. Without the static typing of elm, it ends up being painful to use. Redux drives inexperienced developers to put everything into the store, making it a god-object. See: https://news.ycombinator.com/item?id=14669980 Redux middlewares allow changing return type, which makes it hard to implement static typing to it. Redux without middlewares needs additional code to work with static typing. See: https://github.com/piotrwitek/typesafe-actions Redux expose actions and reducers to developer, which is a state management mechanism that usually are written the same over and over again. I sound harsh on it, but I want devs around the world to not go through the pain of using Redux on large scale project involving a lot of people. Redux is good for
Read the rest
education. It introduce the concept of immutability, higher order function. I learn a lot from it. Nevertheless, it is a pain to use on big projects. React's setState is friendlier to devs. Unstated https://github.com/jamiebuilds/unstated (but not unstated-next), is a detached version of React's setState with additional `.subscribe` method and Promise as return. It is very good in both developing and communicating business flow. UnstatedContainer method can be treated as counterpart of Redux's action. What is missing now from the client-side web development is an in-app event library. Usually people would put domain-objects to Redux to solve the inter-component communication. This is, against the functional programming (which promotes immutability, higher order functions), introducing the possibility side-effect. In-app event library should replace this behavior so that messages can be passed through events from one component to another that resides on different component-tree, which may want to act differently. This is some sort of implementing mini kafka/rabbit-mq-like behavior inside the your web app with minimum resource required.
In Why Redux Makes You a Better JavaScript Developer
Not sure which specific issues you encountered, but I had issues with defining actions and using their types in a union to the reducer. There is a nice little library [1] that fixes this issue. So a general redux setup looks as follows: const FETCH_USERS_BEGIN = "@@FOO/FETCH_USERS_BEGIN" const FETCH_USERS_SUCCESS = "@@FOO/FETCH_USERS_SUCCESS" const FETCH_USERS_ERROR = "@@FOO/FETCH_USERS_ERROR" const fetchUsersBegin = () => action(FETCH_USERS_BEGIN) const fetchUsersSuccess = (users: IUser[]) => action(FETCH_USERS_SUCCESS, users) const fetchUsersError = () => action(FETCH_USERS_ERROR) type IActions = | ReturnType<typeof fetchUsersBegin> | ReturnType<typeof fetchUsersSuccess> | ReturnType<typeof fetchUsersError> interface IUser { id: number name: string } interface IS
Read the rest
tate { readonly isLoading: boolean readonly isErrorLoading: boolean readonly allIds: number[] readonly byId: { readonly [key: number]: IUser } } const defaultState = { isLoading: false, isErrorLoading: false, allIds: [], byId: {} } const reducer = (state: IState = defaultState, action: IActions) => { // narrowing on types switch (action.type) { case FETCH_USERS_BEGIN: return { ...state, isLoading: true, isErrorLoading: false } case FETCH_USERS_SUCCESS: return { ...state, byId: action.payload.reduce( (acc, u) => ({ ...acc, [u.id]: u }), {} ), allIds: action.payload.map(u => u.id), isLoading: false, isErrorLoading: false } case FETCH_USERS_ERROR: return { ...state, isLoading: false, isErrorLoading: true } default: return state } } [1]: https://github.com/piotrwitek/typesafe-actions#1-classic-js-...
In Fear, trust and JavaScript: When types and functional programming fail

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.