@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
37 lines (24 loc) • 1.4 kB
Markdown
---
lang: en
title: 'API docs: context.resolveuntil'
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.resolveuntil.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [resolveUntil](./context.resolveuntil.md)
## resolveUntil() function
Resolve an iterator of source values into a result until the evaluator returns `true`
<b>Signature:</b>
```typescript
export declare function resolveUntil<T, V>(source: Iterator<T>, resolver: (sourceVal: T) => ValueOrPromise<V | undefined>, evaluator: (sourceVal: T, targetVal: V | undefined) => boolean): ValueOrPromise<V | undefined>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| source | Iterator<T> | The iterator of source values |
| resolver | (sourceVal: T) => [ValueOrPromise](./context.valueorpromise.md)<!-- --><V \| undefined> | The resolve function that maps the source value to a result |
| evaluator | (sourceVal: T, targetVal: V \| undefined) => boolean | The evaluate function that decides when to stop |
<b>Returns:</b>
[ValueOrPromise](./context.valueorpromise.md)<!-- --><V \| undefined>