{"action":"created","issue":{"url":"https://api.github.com/repos/leeoniya/domvm/issues/56","repository_url":"https://api.github.com/repos/leeoniya/domvm","labels_url":"https://api.github.com/repos/leeoniya/domvm/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/leeoniya/domvm/issues/56/comments","events_url":"https://api.github.com/repos/leeoniya/domvm/issues/56/events","html_url":"https://github.com/leeoniya/domvm/issues/56","id":149335652,"number":56,"title":"Trouble recreating the view when model changes","user":{"login":"lawrence-dol","id":8662551,"avatar_url":"https://avatars.githubusercontent.com/u/8662551?v=3","gravatar_id":"","url":"https://api.github.com/users/lawrence-dol","html_url":"https://github.com/lawrence-dol","followers_url":"https://api.github.com/users/lawrence-dol/followers","following_url":"https://api.github.com/users/lawrence-dol/following{/other_user}","gists_url":"https://api.github.com/users/lawrence-dol/gists{/gist_id}","starred_url":"https://api.github.com/users/lawrence-dol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lawrence-dol/subscriptions","organizations_url":"https://api.github.com/users/lawrence-dol/orgs","repos_url":"https://api.github.com/users/lawrence-dol/repos","events_url":"https://api.github.com/users/lawrence-dol/events{/privacy}","received_events_url":"https://api.github.com/users/lawrence-dol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-19T03:10:21Z","updated_at":"2016-04-20T00:44:04Z","closed_at":null,"body":"I have a view component with private state, which I want to be recreated whenever a particular model value is changed. I've tried using the documented key, but that does not cause the view to recreate.\r\n\r\nRight now I am fudging my check within the render function, but that seems clumsy and wrong:\r\n\r\n```js\r\n// PARENT VIEW'S RENDER (WANT THE HOST MODEL DISPLAY SERIAL NUMBER TO TRIGGER\r\n// RECREATION\r\n\r\n    return function render(vm) {\r\n        return [ \"div.temjs\", atr, [\r\n            [ dsppnl.view,hstmdl.display()/*,hstmdl.serialNumber()*/ ],\r\n            [ stspnl.view,hstmdl.status () ],\r\n        ]];\r\n    };\r\n\r\n\r\n// SUBCOMPONENT VIEW\r\n\r\nexported.view=view;\r\nfunction view(vm,hstdta) {\r\n    var txt=hstdta.text();\r\n    var cls=hstdta.cellClasses();\r\n    var srl=undefined;\r\n\r\n    if(txt.length==0) { return []; }\r\n\r\n    return function render() {\r\n        // THE SERIAL NUMBER IS THE KEY THAT SHOULD CAUSE THE VIEW RECREATION\r\n        if(srl!==hostSystemModel.serialNumber()) {\r\n            displayGrid=buildGrid(vm,txt,cls);\r\n            hstdta.fldList().forEach(function(fld,idx,arr) {\r\n                cell(fld.sRow,fld.sCol,field(fld,idx,arr,cls[fld.sRow-1][fld.sCol-1]));\r\n            srl=hostSystemModel.serialNumber();\r\n            });\r\n        }\r\n        // ^^^^^^^^^^^^^^^^^^^\r\n\r\n        var dspbdy=[\r\n            \"div.display-box\",{\r\n                oncopy                  : recordScreen,\r\n            },[\r\n                [\"div.display-background\"],\r\n                [\"table.display-panel.C\"+hstdta.dspCol(), displayGrid],\r\n            ],\r\n        ];\r\n\r\n        return dspbdy;\r\n    };\r\n}\r\n````"},"comment":{"url":"https://api.github.com/repos/leeoniya/domvm/issues/comments/212185589","html_url":"https://github.com/leeoniya/domvm/issues/56#issuecomment-212185589","issue_url":"https://api.github.com/repos/leeoniya/domvm/issues/56","id":212185589,"user":{"login":"lawrence-dol","id":8662551,"avatar_url":"https://avatars.githubusercontent.com/u/8662551?v=3","gravatar_id":"","url":"https://api.github.com/users/lawrence-dol","html_url":"https://github.com/lawrence-dol","followers_url":"https://api.github.com/users/lawrence-dol/followers","following_url":"https://api.github.com/users/lawrence-dol/following{/other_user}","gists_url":"https://api.github.com/users/lawrence-dol/gists{/gist_id}","starred_url":"https://api.github.com/users/lawrence-dol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lawrence-dol/subscriptions","organizations_url":"https://api.github.com/users/lawrence-dol/orgs","repos_url":"https://api.github.com/users/lawrence-dol/repos","events_url":"https://api.github.com/users/lawrence-dol/events{/privacy}","received_events_url":"https://api.github.com/users/lawrence-dol/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T00:44:04Z","updated_at":"2016-04-20T00:44:04Z","body":"> if you're not modifying the dom structure or vtree manually, app code should never be able to cause a `sibAtIdx` error.\r\n\r\nI'm not. This one's going to be fun. However it was working a couple of days ago, *after* updating to DOMVM 1.1.0, so there's *something* in my code tripping it. So I am going to work forwards from the last working state with Git and find out *what* buggered it. That should shed light on *why*."}}