Youen Toupin
3 years ago
10 changed files with 52 additions and 10 deletions
@ -0,0 +1,19 @@
|
||||
import m from 'mithril'; |
||||
|
||||
export abstract class Component { |
||||
abstract view(vnode: m.Vnode): m.Children; |
||||
|
||||
oninit(vnode: m.Vnode) {} |
||||
|
||||
oncreate(vnode: m.Vnode) {} |
||||
|
||||
onbeforeupdate(newVnode: m.Vnode, oldVnode: m.Vnode) { |
||||
return true; |
||||
} |
||||
|
||||
onupdate(vnode: m.Vnode) {} |
||||
|
||||
onbeforeremove(vnode: m.Vnode): Promise<void> | void {} |
||||
|
||||
onremove(vnode: m.Vnode) {} |
||||
} |
@ -0,0 +1,5 @@
|
||||
import { Component } from 'components/component'; |
||||
|
||||
export abstract class Page extends Component { |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
import m from 'mithril'; |
||||
import { Component } from 'components/component' |
||||
|
||||
export default class Clock extends Component { |
||||
view(vnode: m.Vnode<{}, {}>): m.Children { |
||||
return <p>clock</p>;
|
||||
} |
||||
} |
@ -1,9 +1,10 @@
|
||||
import m from 'mithril'; |
||||
import { MonitorApi, Status } from './monitor-api'; |
||||
import { Page } from 'components/page'; |
||||
import { MonitorApi, Status } from 'monitor-api'; |
||||
|
||||
require("./raw-data-page.css"); |
||||
|
||||
export default class RawDataPage { |
||||
export class RawDataPage extends Page { |
||||
status: Status = null; |
||||
autoRefresh = true; |
||||
|
@ -1,12 +1,15 @@
|
||||
{ |
||||
"compilerOptions": { |
||||
"noImplicitAny": true, |
||||
"module": "CommonJS", |
||||
"module": "ES6", |
||||
"esModuleInterop": true, |
||||
"target": "es5", |
||||
"jsx": "react", |
||||
"jsxFactory": "m", |
||||
"allowJs": true, |
||||
"moduleResolution": "node" |
||||
"moduleResolution": "node", |
||||
"baseUrl": "./src", |
||||
"paths": { |
||||
} |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue