Skip to content

Commit

Permalink
add root instance
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 28, 2018
1 parent 74bf27d commit e20a58b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ export default function Moon(element, view) {
view = compile(view);
}

view[0]();
view[1]();
view[2]();
const instance = {
name: "@",
data: {},
create: view[0],
mount: view[1],
update: view[2],
m: []
};

instance.create();
instance.mount();
element.parentNode.removeChild(element);

return instance;
}

Moon.extend = (name, view, data) => {
Expand Down

0 comments on commit e20a58b

Please sign in to comment.