subscriptionCount
operator for RxJS
rxjs-subscription-count
Count subscriptions to observables. Useful for testing Observable
flattening strategies.
Installation
Install using NPM CLI
npm install --save rxjs-subscription-count
or using Yarn CLI
yarn add rxjs-subscription-count
Use cases
Test that the subscriptions are switched (switchMap
or switchAll
) correctly
to prevent memory leaks and race conditions.
Usage
;; ;;
switchMap
test case
;; ; describe'switchMap',;
mergeMap
test case
;; ; describe'mergeMap',;