Further improvements

There are definitely more improvements we can make to this code. We did use ES2015 imports to import other files, but most of our code was written in ES5 so why not use most of what ES2015 gives us? Another improvement we can make is introducing immutability and making sure our store is not mutated but transitions from one state to another. 

Let's have a look at the store file, primarily because that is where we can add the most ES2015 syntax. Our revealing module pattern looks like this currently:

// store-event-emitter.jsvar Store = (function(){  const eventEmitter = new EventEmitter();  return {    addListener: listener => {      eventEmitter.on("changed", listener);    },    emitChange: () => {      eventEmitter.emit("changed");    }, getSelectedItem: ...

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.