# operator: use

{% hint style="info" %}
Since version 4.0 `use` operator is deprecated. You can easily compose middlewares directly to the Observable chain.
{% endhint %}

### **Importing**

```typescript
import { use } from '@marblejs/core';
```

### **Type declaration**

```typescript
use :: <I, O>(MiddlewareLike<I, O>, <?>EffectContext) -> Observable<I>
```

### **Parameters**

| *parameter*  | definition                    |
| ------------ | ----------------------------- |
| *middleware* | `MiddlewareLike`              |
| ctx          | *\<optional>* `EffectContext` |

### **Returns**

`Observable<I>`

### Example

```typescript
import { use } from '@marblejs/core';
import { r } from '@marblejs/http';

const foo$ = r.pipe(
  r.matchPath('/'),
  r.matchType('GET'),
  r.useEffet(req$ => req$.pipe(
    // ...
    use(authorize$),
    // ...
  )));
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://marblejs.gitbook.io/docs/other/api-reference/core/operator-use.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
