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

@@ -1,22 +1,22 @@
<template>
<AppSection label="response">
<HttpResponseMeta :response="response" :active="active" />
<div v-if="response.body && response.body !== $t('loading')">
<LensesResponseBodyRenderer :response="response" />
</div>
<HttpResponseMeta v-if="!loading" :response="response" />
<LensesResponseBodyRenderer v-if="!loading" :response="response" />
</AppSection>
</template>
<script>
import { restResponse$ } from "~/newstore/RESTSession"
export default {
props: {
response: {
type: Object,
default: () => {},
},
active: {
type: Boolean,
default: false,
subscriptions() {
return {
response: restResponse$,
}
},
computed: {
loading() {
return this.response === null || this.response.type === "loading"
},
},
}