> For the complete documentation index, see [llms.txt](https://3440217568.gitbook.io/rxswift/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://3440217568.gitbook.io/rxswift/decision_tree/ignoreelements.md).

# ignoreElements

**忽略掉所有的元素，只发出 `error` 或 `completed` 事件**

![](/files/-MWlwRkDFKl0iP-rVOFL)

**ignoreElements** 操作符将阻止 `Observable` 发出 `next` 事件，但是允许他发出 `error` 或 `completed` 事件。

如果你并不关心 `Observable` 的任何元素，你只想知道 `Observable` 在什么时候终止，那就可以使用 **ignoreElements** 操作符。
