Hacker Courses The online courses programmers keep recommending, ranked from 20 years of public forum comments.
i
Implementing the Store from Scratch (Redux)
Image: egghead.io
#1026 overall

Implementing the Store from Scratch (Redux)

egghead.io

1 recommender · 1 thread · recommended in 1 year, 2018 · score 0.7

Go to course ↗

A short egghead.io lesson by Dan Abramov in which he builds a minimal version of Redux's createStore from scratch, covering state, dispatch, subscribe and unsubscribe.

One commenter calls it an excellent course and says it shows the core of Redux in code simple enough to post in a comment.

Web & Mobile Developmentintermediatevideo lectures#redux#react#state management#createStore#abramov

Recommendations by year

20062026

What commenters said (1)

  1. Recommendsicc972018in “Ask HN: What open source project, in your opinion, has the highest code quality?”

    In Dan Abramov's excellent egghead redux course [0] he implements the `createStore` from scratch which is the core of redux, it's simple enough to post here:

    const createStore = (reducer) => { let state; let listeners = [];

    const getState = () => state;

    const dispatch = (action) => { state = reducer(state, action); listeners.map(listener => listener()); };

    const subscribe = (listener) => { listeners.push(listener); // unsubscribe return () => { listeners = listeners.filter(l => l !== listener) }; };

    // populate initial state dispatch({});

    return { getState, dispatch, subscribe }; };

    [0]: https://egghead.io/lessons/react-redux-implementing-store-fr...

Related courses

Keyboard

In the course grid
←↑→↓
Move between courses
Home End
Start / end of row (with Ctrl: first / last)
PgUp PgDn
Jump several rows
Enter
Open course
S
Save / unsave course
1–5
Best, Trending, Hidden gems, Evergreen, Saved
[ ]
Previous / next topic
On a course page
← →
Previous / next course in your list
S
Save / unsave
O
Open the course website
Esc
Back to the grid
Everywhere
/
Search
T
Light / dark theme
?
This help