mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-11-11 15:51:10 +00:00
added catalyst library
This commit is contained in:
32
src/pages/home/Home.ts
Normal file
32
src/pages/home/Home.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { attr, targets, controller, target } from "@github/catalyst";
|
||||
import { closest, index, update, isTrue } from "core/utils";
|
||||
import { html, render, until } from "@github/jtml";
|
||||
import { PingService } from "services";
|
||||
|
||||
@controller
|
||||
class AppMainElement extends HTMLElement {
|
||||
private pingService: PingService;
|
||||
constructor() {
|
||||
super();
|
||||
this.pingService = new PingService();
|
||||
}
|
||||
@update
|
||||
connectedCallback() {}
|
||||
|
||||
getPong = async () => {
|
||||
try {
|
||||
const response = await this.pingService.getAll();
|
||||
return response.api;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
};
|
||||
|
||||
pongEl = () => {
|
||||
return html`<div>${until(this.getPong())}</div>`;
|
||||
};
|
||||
|
||||
update() {
|
||||
render(html`${this.pongEl()}`, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./home/Home";
|
||||
|
||||
Reference in New Issue
Block a user