This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++) { |