kosich / rxjs-autorun

Re-evaluate an expression whenever Observable in it emits
MIT License
33 stars 2 forks source link

Be able to subscribe runner multiple times #9

Closed Jopie64 closed 3 years ago

Jopie64 commented 3 years ago

Different subscriptions should work independently:

it('should subscribe twice', () => {
    let count = 0;
    const o = defer(() => of(++count));
    const r = run(() => $(o));

    r.subscribe();
    r.subscribe();
    expect(count).toBe(2); // <- now it's 1
});

This would fix #6