Table of Contents

Marble diagram

TakeUntil modifies the source sequence so that values are emitted only until the second sequence produces a value. At that time, TakeUntil will terminate immediately and ignore the remainder of the sequence. TakeUntil is often used to create a dynamic stop condition for an infinite sequence.

If the source sequence terminates before the second sequence produces a value, TakeUntil will also terminate and cancel the subscription to the second sequence.

Examples

Use TakeUntil to stop taking elements from an active sequence.

TakeUntil Example

Stop Video Recording

Use TakeUntil to stop video recording when a trigger is sent (e.g. key press).

TakeUntil Application Stop Video Recording

Note

This example requires the Bonsai.Vision, Bonsai.Vision.Design, and Bonsai.Windows.Input packages to be installed.

Note

Use SkipUntil to control the start of video recording.