> For the complete documentation index, see [llms.txt](https://soufatn.gitbook.io/rxjs-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soufatn.gitbook.io/rxjs-book/summary/observable/observable_methods/while.md).

# while | whileDo

Repeats source as long as condition holds emulating a while loop. There is an alias for this method called 'whileDo' for browsers \<IE9.

## Arguments

1. `condition` *(`Function`)*: The condition which determines if the source will be repeated.
2. `source` *(`Observable`)*: The observable sequence that will be run if the condition function returns true.

### Returns

*(`Observable`)*: An observable sequence which is repeated as long as the condition holds.

### Example
