named options

This commit is contained in:
Bruno Windels 2020-11-30 12:49:31 +01:00
parent 91b328f540
commit bb4450e562
2 changed files with 3 additions and 3 deletions

View file

@ -19,8 +19,8 @@ import {ViewModel} from "./utils/ViewModel.js";
import {PreviewViewModel} from "./preview/PreviewViewModel.js";
export class RootViewModel extends ViewModel {
constructor(request) {
super({request});
constructor(options) {
super(options);
this.link = null;
this.previewViewModel = null;
}

View file

@ -3,7 +3,7 @@ import {RootViewModel} from "./RootViewModel.js";
import {RootView} from "./RootView.js";
export async function main(container) {
const vm = new RootViewModel(xhrRequest);
const vm = new RootViewModel({request: xhrRequest});
vm.updateHash(location.hash);
window.__rootvm = vm;
const view = new RootView(vm);