operator: use

Effect operator for composing middleware directly inside request pipeline.

Importing

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

Type declaration

use :: (Middleware, <?>HttpResponse) -> Observable<HttpRequest>

Parameters

parameter

definition

middleware

Middleware (Effect<HttpRequest>) effect

response

<optional> HttpResponse object

Returns

Observable<HttpRequest>

Example

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

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

Last updated