Polymorphic JavaScript using flux architecture, react, and webpack