@web-atoms/core
Version:
31 lines (24 loc) • 813 B
text/typescript
import { App } from "./App";
import { MockNavigationService } from "./services/MockNavigationService";
import { NavigationService } from "./services/NavigationService";
export class MockApp extends App {
private styleElement: HTMLElement;
constructor() {
super();
this.put(NavigationService, new MockNavigationService(this));
}
public updateDefaultStyle(textContent: string) {
if (this.styleElement) {
if (this.styleElement.textContent === textContent) {
return;
}
}
const ss = document.createElement("style");
ss.textContent = textContent;
if (this.styleElement) {
this.styleElement.remove();
}
document.head.appendChild(ss);
this.styleElement = ss;
}
}