# do

**当 `Observable` 产生某些事件时，执行某个操作**

![](https://4217506537-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWj545abP2yK86-qksJ%2Fsync%2F482543241f163689f4bf47497ef57321c5d4671b.png?generation=1616819395849815\&alt=media)

当 `Observable` 的某些事件产生时，你可以使用 **do** 操作符来注册一些回调操作。这些回调会被单独调用，它们会和 `Observable` 原本的回调分离。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://3440217568.gitbook.io/rxswift/decision_tree/do.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
