@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
26 lines (17 loc) • 986 B
Markdown
lang: en
title: 'API docs: context.valueorpromise'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.valueorpromise.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ValueOrPromise](./context.valueorpromise.md)
## ValueOrPromise type
Representing a value or promise. This type is used to represent results of synchronous/asynchronous resolution of values.
Note that we are using PromiseLike instead of native Promise to describe the asynchronous variant. This allows producers of async values to use any Promise implementation (e.g. Bluebird) instead of native Promises provided by JavaScript runtime.
<b>Signature:</b>
```typescript
export declare type ValueOrPromise<T> = T | PromiseLike<T>;
```