provide confdata as type
This commit is contained in:
parent
1ad9e70c00
commit
5f793c354e
1 changed files with 9 additions and 8 deletions
|
@ -1,16 +1,16 @@
|
|||
import { api, polling } from './settings'
|
||||
|
||||
const confdata = {
|
||||
pollurl: ''
|
||||
type confdata = {
|
||||
pollurl: string
|
||||
}
|
||||
|
||||
export function config (api, polling) {
|
||||
return undefined
|
||||
export function config (api, polling): confdata {
|
||||
return { pollurl: '' }
|
||||
}
|
||||
|
||||
export const pvapp = {
|
||||
$delimiters: ['{|', '|}'],
|
||||
conf: confdata,
|
||||
conf: {} as confdata,
|
||||
data: {},
|
||||
output: '',
|
||||
save,
|
||||
|
@ -28,9 +28,10 @@ async function dopoll(app: typeof pvapp) {
|
|||
while (true) {
|
||||
try {
|
||||
let res = await fetch(pvapp.conf.pollurl)
|
||||
let data = await res.json()
|
||||
console.log(data)
|
||||
//obj.newdata = data['status']
|
||||
let msg = await res.json()
|
||||
console.log(msg)
|
||||
//app.handle(msg)
|
||||
//app.newdata = data['status']
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
await new Promise(r => setTimeout(r, 10000))
|
||||
|
|
Loading…
Add table
Reference in a new issue