autoUnsubcribe operator - which makes auto unscribe from an observable automatic #7486
hansschenker
started this conversation in
Ideas / Feature request
Replies: 2 comments
-
I believe you can achieve this by using |
Beta Was this translation helpful? Give feedback.
0 replies
-
yes you can but you have to know it and it needs additional steps, this
operator would help not to forget to unsubscribe
…On Wed, Jul 3, 2024 at 10:32 PM Aron Hoxha ***@***.***> wrote:
I believe you can achieve this by using share/shareReplay with refcount
option
—
Reply to this email directly, view it on GitHub
<#7486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEUBS52LWQNZQXNA4SGHEM3ZKRNVLAVCNFSM6AAAAABJ5QJZPSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TSNJSGI4DQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
import { autoUnsubscribe } from './autoUnsubscribe';
describe('autoUnsubscribe operator', () => {
it('should unsubscribe from source when all subscribers unsubscribe', () => {
const source$ = of('a', 'b', 'c');
const autoUnsubscribed$ = source$.pipe(autoUnsubscribe());
});
});
Beta Was this translation helpful? Give feedback.
All reactions