@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
45 lines (30 loc) • 1.37 kB
Markdown
---
lang: en
title: 'API docs: context.dynamicvalueproviderclass'
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.dynamicvalueproviderclass.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [DynamicValueProviderClass](./context.dynamicvalueproviderclass.md)
## DynamicValueProviderClass interface
A class with a static `value` method as the factory function for `toDynamicValue`<!-- -->.
<b>Signature:</b>
```typescript
export interface DynamicValueProviderClass<T = unknown> extends Constructor<unknown>, Function
```
<b>Extends:</b> [Constructor](./context.constructor.md)<!-- --><unknown>, Function
## Example
```ts
import {inject} from '@loopback/context';
export class DynamicGreetingProvider {
static value(@inject('currentUser') user: string) {
return `Hello, ${user}`;
}
}
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [value](./context.dynamicvalueproviderclass.value.md) | (...args: [BoundValue](./context.boundvalue.md)<!-- -->\[\]) => [ValueOrPromise](./context.valueorpromise.md)<!-- --><T> | |