operator: use

Effect operator for composing middleware directly inside stream pipeline.

Importing

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

Type declaration

use :: <I, O>(MiddlewareLike<I, O>, <?>any, <?>any) -> Observable<I>

Parameters

parameter

definition

middleware

MiddlewareLike

client

<optional> protocol specific client instance

meta

<optional> EffectMetadata

Returns

Observable<I>

Example

import { r, use } from '@marblejs/core';
const foo$ = r.pipe(
r.matchPath('/'),
r.matchType('GET'),
r.useEffet(req$ => req$.pipe(
// ...
use(authorize$),
// ...
)));