Options
All
  • Public
  • Public/Protected
  • All
Menu

Convenience return type for reading data from a clone. Use as a Promise with .then or await to obtain the results as an array of identified Subjects (with a graph mode). Use as an Observable with .subscribe (or other RxJS methods) to be notified of individual Subjects as they arrive. Or consume the results one-by-one with backpressure using Flowable.consume.

If results are consumed outside the scope of a read procedure, they may be affected by concurrent writes (this is equivalent to a monotonic atomic view). If the results are being used to strictly maintain a downstream data model, use a read procedure and hold it open by returning completed. TODO: Example

see

MeldStateMachine.read

Hierarchy

Implements

Index

Constructors

constructor

  • Parameters

    • Optional subscribe: undefined | ((this: Observable<GraphSubject>, subscriber: Subscriber<GraphSubject>) => 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 ReadResult

Properties

completed

completed: PromiseLike<unknown>

Readonly consume

operator

operator: Operator<any, GraphSubject> | 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: GraphSubject) => void): Promise<void>
  • forEach(next: (value: GraphSubject) => void, promiseCtor: PromiseConstructorLike): Promise<void>
  • Used as a NON-CANCELLABLE means of subscribing to an observable, for use with APIs that expect promises, like async/await. You cannot unsubscribe from this.

    WARNING: Only use this with observables you know will complete. If the source observable does not complete, you will end up with a promise that is hung up, and potentially all of the state of an async function hanging out in memory. To avoid this situation, look into adding something like {@link timeout}, {@link take}, {@link takeWhile}, or {@link takeUntil} amongst others.

    Example:

    import { interval } from 'rxjs';
    import { take } from 'rxjs/operators';
    
    const source$ = interval(1000).pipe(take(4));
    
    async function getTotal() {
       let total = 0;
    
       await source$.forEach(value => {
         total += value;
         console.log('observable -> ', value);
       });
    
       return total;
    }
    
    getTotal().then(
       total => console.log('Total:', total)
    )
    
    // Expected:
    // "observable -> 0"
    // "observable -> 1"
    // "observable -> 2"
    // "observable -> 3"
    // "Total: 6"
    

    Parameters

    Returns Promise<void>

    a promise that either resolves on observable completion or rejects with the handled error

  • deprecated

    Passing a Promise constructor will no longer be available in upcoming versions of RxJS. This is because it adds weight to the library, for very little benefit. If you need this functionality, it is recommended that you either polyfill Promise, or you create an adapter to convert the returned native promise to whatever promise implementation you wanted. Will be removed in v8.

    Parameters

    • next: (value: GraphSubject) => void

      a handler for each value emitted by the observable

    • promiseCtor: PromiseConstructorLike

      a constructor function used to instantiate the Promise

    Returns Promise<void>

    a promise that either resolves on observable completion or rejects with the handled error

lift

  • lift<R>(operator?: Operator<GraphSubject, 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<GraphSubject, R>

      the operator defining the operation to take on the observable

    Returns Observable<R>

    a new observable with the Operator applied

pipe

  • pipe(): Observable<GraphSubject>
  • pipe<A>(op1: OperatorFunction<GraphSubject, A>): Observable<A>
  • pipe<A, B>(op1: OperatorFunction<GraphSubject, A>, op2: OperatorFunction<A, B>): Observable<B>
  • pipe<A, B, C>(op1: OperatorFunction<GraphSubject, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>
  • pipe<A, B, C, D>(op1: OperatorFunction<GraphSubject, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>
  • pipe<A, B, C, D, E>(op1: OperatorFunction<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject>

  • Type parameters

    • A

    Parameters

    Returns Observable<A>

  • Type parameters

    • A

    • B

    Parameters

    • op1: OperatorFunction<GraphSubject, A>
    • op2: OperatorFunction<A, B>

    Returns Observable<B>

  • Type parameters

    • A

    • B

    • C

    Parameters

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

    Returns Observable<C>

  • Type parameters

    • A

    • B

    • C

    • D

    Parameters

    • op1: OperatorFunction<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject, 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<GraphSubject>>): Subscription
  • subscribe(next: (value: GraphSubject) => void): Subscription
  • subscribe(next?: ((value: GraphSubject) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription

then

  • then<TResult1, TResult2>(onfulfilled?: ((value: GraphSubjects) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>
  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type parameters

    • TResult1

    • TResult2

    Parameters

    • Optional onfulfilled: ((value: GraphSubjects) => TResult1 | PromiseLike<TResult1>) | undefined | null

      The callback to execute when the Promise is resolved.

    • Optional onrejected: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null

      The callback to execute when the Promise is rejected.

    Returns PromiseLike<TResult1 | TResult2>

    A Promise for the completion of which ever callback is executed.

toPromise

  • toPromise(): Promise<GraphSubject | undefined>
  • toPromise(PromiseCtor: typeof Promise): Promise<GraphSubject | undefined>
  • toPromise(PromiseCtor: PromiseConstructorLike): Promise<GraphSubject | 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