---
lang: en
title: 'API docs: context.asvalueorpromise'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.asvalueorpromise.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [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>;
```
<b>References:</b> [ValueOrPromise](./context.valueorpromise.md)


