Skip to content

Commit

Permalink
allow precompiled views
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jun 29, 2018
1 parent a7d6267 commit 446d549
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@
if (typeof data.view === "string") {
this._view = new Function("m", "instance", "locals", compile(data.view))(m, this, {});
} else {
this._view = data.view;
this._view = data.view(m, this, {});
}

delete data.view;
Expand Down
2 changes: 1 addition & 1 deletion dist/moon.min.js

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

2 changes: 1 addition & 1 deletion src/component/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const component = (name, data) => {
if (typeof data.view === "string") {
this._view = new Function("m", "instance", "locals", compile(data.view))(m, this, {});
} else {
this._view = data.view;
this._view = data.view(m, this, {});
}

delete data.view;
Expand Down

0 comments on commit 446d549

Please sign in to comment.