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

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [GenericInterceptorChain](./context.genericinterceptorchain.md) &gt; [(constructor)](./context.genericinterceptorchain._constructor__1.md)

## GenericInterceptorChain.(constructor)

Create an invocation interceptor chain with a binding filter and comparator. The interceptors are discovered from the context using the binding filter and sorted by the comparator (if provided).

**Signature:**

```typescript
constructor(context: C, filter: BindingFilter, comparator?: BindingComparator);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

context


</td><td>

C


</td><td>

Context object


</td></tr>
<tr><td>

filter


</td><td>

[BindingFilter](./context.bindingfilter.md)


</td><td>

A binding filter function to select interceptors


</td></tr>
<tr><td>

comparator


</td><td>

[BindingComparator](./context.bindingcomparator.md)


</td><td>

_(Optional)_ An optional comparator to sort matched interceptor bindings


</td></tr>
</tbody></table>

