@loopback/docs
Version:
Documentation for LoopBack 4
23 lines (15 loc) • 698 B
Markdown
---
lang: en
title: 'API docs: context.asvalueorpromise'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.asvalueorpromise.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [AsValueOrPromise](./context.asvalueorpromise.md)
## AsValueOrPromise type
Create the Promise type for `T`<!-- -->. If `T` extends `Promise`<!-- -->, the type is `T`<!-- -->, otherwise the type is `ValueOrPromise<T>`<!-- -->.
<b>Signature:</b>
```typescript
export declare type AsValueOrPromise<T> = T extends Promise<unknown> ? T : ValueOrPromise<T>;
```