Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combineLatest wrong documentation or implementation #4745

Open
1 of 5 tasks
basvermeulen opened this issue Apr 29, 2019 · 0 comments
Open
1 of 5 tasks

combineLatest wrong documentation or implementation #4745

basvermeulen opened this issue Apr 29, 2019 · 0 comments

Comments

@basvermeulen
Copy link

basvermeulen commented Apr 29, 2019

Documentation Related To Component:

combineLatest

Please check those that apply

  • typo
  • documentation doesn't exist
  • documentation needs clarification
  • error(s) in example
  • needs example

Description Of The Issue

It seems to me that the sentence "On the other hand, if some Observable does not emit a value but completes, resulting Observable will complete at the same moment without emitting anything, since it will be now impossible to include value from completed Observable in resulting array." in the 3rd paragraph is either incorrect or the expected behaviour of combineLatest is implemented incorrect.

If we have a look at :

  it('should work with never and empty', () => {
    const e1 = cold( '-');
    const e1subs =   '^';
    const e2 = cold( '|');
    const e2subs =   '(^!)';
    const expected = '-';

    const result = combineLatest(e1, e2, (x, y) => x + y);

    expectObservable(result).toBe(expected);
    expectSubscriptions(e1.subscriptions).toBe(e1subs);
    expectSubscriptions(e2.subscriptions).toBe(e2subs);
  });

To me at least it seems like const expected = '-'; should be const expected = '|'; since observable 'e2' completes immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant