Skip to content

Instantly share code, notes, and snippets.

@romagny13
romagny13 / redux-in-5-minutes.js
Created July 13, 2017 11:34
Understand Redux in 5 minutes
export class Store {
constructor(executor, initialState = {}) {
this.subscribers = [];
this.state = initialState;
// function that executes reducer or combined reducers and returns the new state
this.executor = executor;
}
notifySubscribers() {
for (let i = 0; i < this.subscribers.length; i++) {