I am not sure what is your concern, but I am under the impression that it's all about counting, why don't you make use of rxjs count operator? for example: of(1, 2, 3).pipe(count()).subscribe(console.log); this will log "3" If this is not helping, could you collaborate more on what exactly are you looking for?