Skip to content

Commit

Permalink
Proposed fix for #16
Browse files Browse the repository at this point in the history
The root view trap can't capture a fully computed virtual DOM snapshot because of Mithril's deferred computation of nested components. This should solve the problem by capturing fully computed snapshots post render.
  • Loading branch information
barneycarroll committed Mar 17, 2016
1 parent 363d8f5 commit c7c9b94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/exitable.es3.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
var config = node.attrs.config

// Map the root / first child element to the component instance
node.attrs.config = function superConfig( el ){
node.attrs.config = function superConfig( el, init, ctxt, snapshot ){
roots.set( ctrl, el )

if( history.has( ctrl )
history.set( ctrl, snapshot )

if( config )
return config.apply( this, arguments )
Expand Down

0 comments on commit c7c9b94

Please sign in to comment.