addyosmani / essential-js-design-patterns

Repo for my 'Learning JavaScript Design Patterns' book
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
4.8k stars 791 forks source link

Fix example for Implementing Classical Flyweights #191

Closed mieszko4 closed 7 years ago

mieszko4 commented 8 years ago

I would also drop new when constructing CoffeeOrderContext and CoffeeFlavorFactory since they return custom objects but I am not sure if perhaps it would be better to change them to real constructors returning this.