How to make an rxjs marble sync grouping only take up one frame
Asked Answered
D

1

4

According to https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/testing/marble-testing.md#marble-syntax

'--(abc)-|': on frame 20, emit a, b, and c, then on frame 80 complete

So how do I represent "on frame 20, emit a, b, and c, then on frame 40 complete.

Ie how can I stop the sync group itself taking up frames?

Detribalize answered 19/10, 2017 at 21:22 Comment(1)
You can't; there's nothing you can do about it. The example from the documentation that you've included in the question describes the TestScheduler's behaviour.Gilly
D
2

cartant has answered this question in his comment.

There's no way to do it - sync groups will always take up extra frames even though all members occur in the frame of the opening bracket.

Detribalize answered 20/10, 2017 at 9:3 Comment(1)
Just in case this might help anyone else, there's an alternative library that provides this functionality: https://mcmap.net/q/1519980/-how-to-test-observables-which-emit-grouped-events-with-rxjs-marblesHaymow

© 2022 - 2024 — McMap. All rights reserved.