diff options
Diffstat (limited to '')
-rw-r--r-- | third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/es2015/src/app.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/es2015/src/app.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/es2015/src/app.js new file mode 100644 index 0000000000..e65d9c56d1 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/es2015/src/app.js @@ -0,0 +1,27 @@ +'use strict'; + +let todo; +const setView = () => todo.controller.setView(document.location.hash); + +class Todo { + /** + * Init new Todo List + * @param {string} The name of your list + */ + constructor(name) { + this.storage = new Store(name); + this.model = new Model(this.storage); + + this.template = new Template(); + this.view = new View(this.template); + + this.controller = new Controller(this.model, this.view); + } +} + +$on(window, 'load', () => { + todo = new Todo('todos-vanillajs'); + setView(); +}); + +$on(window, 'hashchange', setView); |