---
lang: en
title: 'API docs: context.valuefactory'
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.valuefactory.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [ValueFactory](./context.valuefactory.md)

## ValueFactory type

A factory function for `toDynamicValue`

**Signature:**

```typescript
export type ValueFactory<T = unknown> = (resolutionCtx: ResolutionContext) => ValueOrPromise<T | undefined>;
```
**References:** [ResolutionContext](./context.resolutioncontext.md)<!-- -->, [ValueOrPromise](./context.valueorpromise.md)


