• Dynamic typing (ok that doesn’t have to be bad) • General weirdness, e. g. == vs === • No nice features, not even string interpolation • Awkward implementations of patterns, e.g. prototype based inheritance • protip: eschew inheritance altogether • Capricious run time environment, e. g. error handling
Usually has an instance of a model • listens for events on the DOM (submit form) • listens for events on the model (change field) • decides what to do about them Controller
/ store • No models! • No behaviour, just data - hash, array, whatever • All in one place, no ambiguity • State is immutable (read only) • No classes, just pure functions
are pure functions • They accept the old state, and the action as parameters • They return a new version of the state, without modifying the original. • new state gets sent to the store, and an event is emitted
=> new data • pure functions are easy to test • audit log of everything thats happened in the system • time travel! • restore state • debug • store on the server? • live collaboration