> 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/empty.md).

# empty

**创建一个空 `Observable`**

![](/files/-MWlwQroTfa6ylzpSzV2)

**empty** 操作符将创建一个 `Observable`，这个 `Observable` 只有一个完成事件。

## 演示

创建一个空 `Observable`：

```swift
let id = Observable<Int>.empty()
```

它相当于：

```swift
let id = Observable<Int>.create { observer in
    observer.onCompleted()
    return Disposables.create()
}
```
