@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
32 lines (20 loc) • 771 B
Markdown
---
lang: en
title: 'API docs: context.setter'
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.setter.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Setter](./context.setter.md)
## Setter type
The function injected by `@inject.setter(bindingKey)`<!-- -->. It sets the underlying binding to a constant value using `binding.to(value)`<!-- -->.
<b>Signature:</b>
```typescript
export declare type Setter<T> = (value: T) => void;
```
## Example
```ts
setterFn('my-value');
```