Skip to content

Commit

Permalink
remove view current
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jun 14, 2019
1 parent b3af5f2 commit d600a18
Show file tree
Hide file tree
Showing 6 changed files with 1,585 additions and 37 deletions.
19 changes: 3 additions & 16 deletions packages/moon/dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@
/**
* Global views
*/
var viewOld, viewCurrent, viewNew;
var viewOld, viewNew;
/**
* Global component store
*/
Expand Down Expand Up @@ -1131,15 +1131,6 @@
function setViewOld(viewOldNew) {
viewOld = viewOldNew;
}
/**
* Set current view to a new function.
*
* @param {Function} viewCurrentNew
*/

function setViewCurrent(viewCurrentNew) {
viewCurrent = viewCurrentNew;
}
/**
* Set new view to a new object.
*
Expand Down Expand Up @@ -1430,7 +1421,7 @@
} // Begin the view phase.


setViewNew(viewCurrent(m, md, mc, ms.Root));
setViewNew(components.Root(m, md, mc, ms.Root));
executeView([viewNew]);
}
/**
Expand Down Expand Up @@ -1517,7 +1508,7 @@

ms[name] = []; // Create a wrapper view function that processes default data if needed.

var viewComponent = dataDefault === undefined ? view : function (m, md, mc, ms) {
components[name] = dataDefault === undefined ? view : function (m, md, mc, ms) {
for (var key in dataDefault) {
if (!(key in md)) {
md[key] = dataDefault[key];
Expand Down Expand Up @@ -1550,11 +1541,7 @@
}

setViewOld(new NodeOld(new NodeNew(types.element, root.tagName.toLowerCase(), dataNode, []), root, []));
setViewCurrent(viewComponent);
execute(defaultValue(dataDefault, {}));
} else {
// Store it as a component if no `root` is given.
components[name] = viewComponent;
}
}
Moon.lex = lex;
Expand Down
2 changes: 1 addition & 1 deletion packages/moon/dist/moon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/moon/src/executor/executor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { setEvent, updateAttributeSet, removeAttributeSet } from "./util/util";
import { components, md, mc, ms, viewCurrent, viewNew, viewOld, setViewNew } from "../util/globals";
import { components, md, mc, ms, viewNew, viewOld, setViewNew } from "../util/globals";
import { m, NodeOld, types } from "../util/util";

/**
Expand Down Expand Up @@ -319,7 +319,7 @@ function executeNext() {
}

// Begin the view phase.
setViewNew(viewCurrent(m, md, mc, ms.Root));
setViewNew(components.Root(m, md, mc, ms.Root));
executeView([viewNew]);
}

Expand Down

0 comments on commit d600a18

Please sign in to comment.