Message from JavaScript discussions
November 2016
— Hahaha god example
Floofies please let me know if I understood your problem correctly - also, it would be useful to know how renderProcedure
is implemented, or some examples
— Yes exactly
— renderProcedure
is just a callback that gets executed by the views, it contains calls to jQuery-Template
and manipulates the DOM, then adds event listeners to the dispatcher
— When the important parts of the template are done loading (for instance containers for other views, or just the whole thing), resolve()
is used to alert the controllerview to move on to the next view
— So, a simple example would be this http://pastebin.com/6TLydass
— That callback is fed into the viewFactory
as the callback
argument
— And, then executed here
render: function (pageData) {
return new Promise (function (resolve, reject) {
renderProcedure(resolve, reject, pageData);
});
}
— And so... the issue is pretty simple. Lets say I load View A with Data 1234
. Then, I load View B, which overwrites all elements in the DOM. If I load View A again with 1234
, it will not render.
— Basically I need to figure out a way to tell the view it needs to render, regardless of the diff check result
— And if you look at the componentUpdate
interface, it does indeed have a force
argument, so the functionality to make it render is there, just not the mechanism to detect when we need to use it
— I see, how do you load views? what's your mechanism to do that?