Options
All
  • Public
  • Public/Protected
  • All
Menu

A consumable is an observable that is

  • always in pull/paused/consuming mode (cf. Flowable)
  • hot if there is at least one subscriber (not represented in the typing)

This is an interface to ease the use of RxJS pipe operators and utilities like EMPTY. However note that some (e.g. from and merge) may create misbehaving consumables that flow with incorrect backpressure.

Note that a consumable is generally more prone to resource leaks than a typical observable, because resources may be held open while waiting for backpressure to be relieved by a call to {@link Bite.next()}. Such leaks can even occur if the consumable is never subscribed, because of pre-emptive actions taken when it was created, prior to the first consumer/subscriber.

see

Bite

Type parameters

  • T

Hierarchy

  • Observable<Bite<T>>
    • Consumable

Implements

  • Subscribable<Bite<T>>

Implemented by

Index

Constructors

constructor

  • new Consumable(subscribe?: undefined | ((this: Observable<Bite<T>>, subscriber: Subscriber<Bite<T>>) => TeardownLogic)): Consumable
  • Parameters

    • Optional subscribe: undefined | ((this: Observable<Bite<T>>, subscriber: Subscriber<Bite<T>>) => TeardownLogic)

      the function that is called when the Observable is initially subscribed to. This function is given a Subscriber, to which new values can be nexted, or an error method can be called to raise an error, or complete can be called to notify of a successful completion.

    Returns Consumable

Properties

operator

operator: Operator<any, Bite<T>> | undefined
deprecated

Internal implementation detail, do not use directly. Will be made internal in v8.

source

source: Observable<any> | undefined
deprecated

Internal implementation detail, do not use directly. Will be made internal in v8.

Static create

create: (...args: any[]) => any

Creates a new Observable by calling the Observable constructor

owner

Observable

method

create

param

the subscriber function to be passed to the Observable constructor

returns

a new observable

nocollapse
deprecated

Use new Observable() instead. Will be removed in v8.

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

Methods

forEach

  • forEach(next: (value: Bite<T>) => void): Promise<void>
  • deprecated

    use each

    Parameters

    • next: (value: Bite<T>) => void
        • (value: Bite<T>): void
        • Parameters

          Returns void

    Returns Promise<void>

lift

  • lift<R>(operator?: Operator<Bite<T>, R>): Observable<R>
  • Creates a new Observable, with this Observable instance as the source, and the passed operator defined as the new observable's operator.

    method

    lift

    deprecated

    Internal implementation detail, do not use directly. Will be made internal in v8. If you have implemented an operator using lift, it is recommended that you create an operator by simply returning new Observable() directly. See "Creating new operators from scratch" section here: https://rxjs.dev/guide/operators

    Type parameters

    • R

    Parameters

    • Optional operator: Operator<Bite<T>, R>

      the operator defining the operation to take on the observable

    Returns Observable<R>

    a new observable with the Operator applied

pipe

  • pipe(): Observable<Bite<T>>
  • pipe<A>(op1: OperatorFunction<Bite<T>, A>): Observable<A>
  • pipe<A, B>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>): Observable<B>
  • pipe<A, B, C>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>
  • pipe<A, B, C, D>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>
  • pipe<A, B, C, D, E>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>
  • pipe<A, B, C, D, E, F>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>
  • pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>
  • pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>
  • pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>
  • pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<Bite<T>, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<unknown>
  • Returns Observable<Bite<T>>

  • Type parameters

    • A

    Parameters

    • op1: OperatorFunction<Bite<T>, A>

    Returns Observable<A>

  • Type parameters

    • A

    • B

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>

    Returns Observable<B>

  • Type parameters

    • A

    • B

    • C

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>

    Returns Observable<C>

  • Type parameters

    • A

    • B

    • C

    • D

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>
    • op4: OperatorFunction<C, D>

    Returns Observable<D>

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>
    • op4: OperatorFunction<C, D>
    • op5: OperatorFunction<D, E>

    Returns Observable<E>

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    • F

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>
    • op4: OperatorFunction<C, D>
    • op5: OperatorFunction<D, E>
    • op6: OperatorFunction<E, F>

    Returns Observable<F>

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>
    • op4: OperatorFunction<C, D>
    • op5: OperatorFunction<D, E>
    • op6: OperatorFunction<E, F>
    • op7: OperatorFunction<F, G>

    Returns Observable<G>

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>
    • op4: OperatorFunction<C, D>
    • op5: OperatorFunction<D, E>
    • op6: OperatorFunction<E, F>
    • op7: OperatorFunction<F, G>
    • op8: OperatorFunction<G, H>

    Returns Observable<H>

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>
    • op4: OperatorFunction<C, D>
    • op5: OperatorFunction<D, E>
    • op6: OperatorFunction<E, F>
    • op7: OperatorFunction<F, G>
    • op8: OperatorFunction<G, H>
    • op9: OperatorFunction<H, I>

    Returns Observable<I>

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I

    Parameters

    • op1: OperatorFunction<Bite<T>, A>
    • op2: OperatorFunction<A, B>
    • op3: OperatorFunction<B, C>
    • op4: OperatorFunction<C, D>
    • op5: OperatorFunction<D, E>
    • op6: OperatorFunction<E, F>
    • op7: OperatorFunction<F, G>
    • op8: OperatorFunction<G, H>
    • op9: OperatorFunction<H, I>
    • Rest ...operations: OperatorFunction<any, any>[]

    Returns Observable<unknown>

subscribe

  • subscribe(observer?: Partial<Observer<Bite<T>>>): Subscription
  • subscribe(next: (value: Bite<T>) => void): Subscription
  • subscribe(next?: ((value: Bite<T>) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription
  • Parameters

    • Optional observer: Partial<Observer<Bite<T>>>

    Returns Subscription

  • Parameters

    • next: (value: Bite<T>) => void
        • (value: Bite<T>): void
        • Parameters

          Returns void

    Returns Subscription

  • deprecated

    Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments

    Parameters

    • Optional next: ((value: Bite<T>) => void) | null
    • Optional error: ((error: any) => void) | null
    • Optional complete: (() => void) | null

    Returns Subscription

toPromise

  • toPromise(): Promise<Bite<T> | undefined>
  • toPromise(PromiseCtor: typeof Promise): Promise<Bite<T> | undefined>
  • toPromise(PromiseCtor: PromiseConstructorLike): Promise<Bite<T> | undefined>

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.7.1-4 Source code licensed MIT. Privacy policy