Protected
_configProtected
_delayProtected
_fieldsProtected
_incrementalProtected
_modelProtected
_pagingProtected
_populatesProtected
_queryProtected
_sortProtected
_subscriptionProtected
_subscriptionProtected
_subscriptionProtected
_targetProtected
_typeProtected
_virtualsStatic
createCreates a "subject" by basically gluing an observer to an observable.
Protected
modelProtected
subscriptionCreates a new Observable with this Subject as the source. You can do this to create custom Observer-side logic of the Subject and conceal it from code that uses the Observable.
Observable that this Subject casts to.
Protected
emitProtected
emitProtected
emitProtected
emitProtected
emitProtected
extractUsed 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 timeout, take, takeWhile, or takeUntil amongst others.
import { interval, take } from 'rxjs';
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'
A handler for each value emitted by the observable.
A promise that either resolves on observable completion or rejects with the handled error.
a handler for each value emitted by the observable
a constructor function used to instantiate the Promise
a promise that either resolves on observable completion or rejects with the handled error
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.
Protected
isProtected
isProtected
loadProtected
removeProtected
shouldProtected
shouldOptional
observerOrNext: Partial<Observer<any>> | (value: any) => voidOptional
next: (value: any) => voidOptional
error: (error: any) => voidOptional
complete: () => voidInstead 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
Protected
testReplaced with firstValueFrom and lastValueFrom. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise
Replaced with firstValueFrom and lastValueFrom. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise
Replaced with firstValueFrom and lastValueFrom. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise
Deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.