Added a basic DOM diff algorithm

This commit is contained in:
2017-06-21 18:44:20 +02:00
parent 9bd5e71205
commit b4a4e78c96
6 changed files with 77 additions and 14 deletions

View File

@ -1,4 +1,5 @@
import { Application } from "./Application"
import { Diff } from "./Diff"
import { findAll } from "./utils"
import * as actions from "./actions"
@ -23,6 +24,14 @@ export class AnimeNotifier {
this.app.run()
}
reloadContent() {
return fetch("/_" + this.app.currentPath, {
credentials: "same-origin"
})
.then(response => response.text())
.then(html => Diff.innerHTML(this.app.content, html))
}
loading(isLoading: boolean) {
if(isLoading) {
this.app.loading.classList.remove(this.app.fadeOutClass)