Mirror at most 1 value from source, then temporarily drop values until another observable emits

Viewed 39

I would like to combine two observables in such a way that

  • I mirror at most 1 value from the source observable (same moment it arrives),
  • Then ignore its subsequent values until the notifier observable emits;
  • Then, I allow to mirror at most 1 more value from the source;
  • After which I again ignore elements until the notifier observable emits
  • etc.

Source:

a----a----a----a----a----a Source
------------b---------b--- Notifier
a--------------a---------a Desired result

The observables are infinite.

Can you please suggest a recipe to achieve this?

1 Answers
Related