Creating a Redux-like state container

Redux is basically a module for managing state in JavaScript apps. Though it's commonly used with React.js, you can use it with any framework or none at all. The learning curve with Redux tends to be conceptual. You have to remember that the state of your application is stored in one object. To alter the state, you publish actions: object literals describing what should change. Redux passes the published action to reducers: idempotent, deterministic functions that return a new state:

reducer(currentState, action) => newState  

A good way to learn the key concepts in Redux is to implement a state container from scratch. I wrote the example Store class below using ES6 and TypeScript. Scroll to the end of the Gist to see how Store is instantiated and used: