api-client/components/http/Response.vue

28 lines
681 B
Vue
Raw Normal View History

<template>
<AppSection label="response">
<HttpResponseMeta :response="response" />
2021-07-13 05:37:29 +00:00
<LensesResponseBodyRenderer v-if="!loading" :response="response" />
</AppSection>
</template>
2021-08-12 08:14:10 +00:00
<script lang="ts">
import { computed, defineComponent } from "@nuxtjs/composition-api"
import { useReadonlyStream } from "~/helpers/utils/composables"
2021-07-13 05:37:29 +00:00
import { restResponse$ } from "~/newstore/RESTSession"
2021-08-12 08:14:10 +00:00
export default defineComponent({
setup() {
const response = useReadonlyStream(restResponse$, null)
const loading = computed(
() => response.value === null || response.value.type === "loading"
)
2021-07-13 05:37:29 +00:00
return {
2021-08-12 08:14:10 +00:00
response,
loading,
2021-07-13 05:37:29 +00:00
}
},
2021-08-12 08:14:10 +00:00
})
</script>