feat: init new response state system

This commit is contained in:
liyasthomas
2021-07-13 11:07:29 +05:30
parent ffc891f38e
commit a4032836c3
20 changed files with 620 additions and 387 deletions

View File

@@ -0,0 +1,22 @@
export type HoppRESTResponse =
| { type: "loading" }
| {
type: "fail"
headers: { key: string; value: string }[]
body: ArrayBuffer
statusCode: number
}
| {
type: "network_fail"
error: Error
}
| {
type: "success"
headers: { key: string; value: string }[]
body: ArrayBuffer
statusCode: number
meta: {
responseSize: number // in bytes
responseDuration: number // in millis
}
}