Message from JavaScript discussions

November 2016

— Use your actual dom as a state


So there is a dispatcher which updates stores, which fire events, which tell the ControllerViews to access the stores via getters. The data is diffed per-view component and then a rendering procedure is executed if the data differs from old data

— Get the inner text and check if new value is different

— This would add a lot of code :c

— Right now I do this

var newData = Object.assign(view.viewDataTemplate, view.viewData, pageData);
var isNewData = false;
for (var i = 0; i < view.viewDataKeysCount; i++) {
if (view.viewData[view.viewDataKeys[i]] !== newData[view.viewDataKeys[i]] || force) {
view.viewData[view.viewDataKeys[i]] = newData[view.viewDataKeys[i]];
isNewData = true;

Message permanent page

— pageData is fresh data from the store

— viewData is the old data stored inside the component

— So this code uses a template and it's accessors to only diff data that is relevant to the component

— If exist new data refres all view

— Not spesific part

— I thought each component checked the data

— I suppose I should say "child views" not components