1. 程式人生 > >Create components with ES6 Vanilla Javascript.

Create components with ES6 Vanilla Javascript.

Ok so we’re going to go pretty high level, not too much into detail because it will take forever, First, lets start with the es6 IIFE:

es6 IIFE, I have reassigned global variables to shorten the DOM lookup and when referencing.

Why I did this? Who wants to write out setTimeout when you can shorten it to ‘sto’, and the rest of the crew of globals. The ‘undefined’ is set so that if you call a global in the IIFE and it doesn’t exist, it will throw an undefined, well it suppose to at least, I’ve never ran into that situation.

ES6 Classes formalize the common JavaScript pattern of simulating class-like inheritance hierarchies using functions and prototypes. They are effectively simple sugaring over prototype-based OO, offering a convenient declarative form for class patterns which encourage interoperability. — Reference

Next step, inside the es6 class Component —