<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/CurrentValueSubject",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine19CurrentValueSubjectC"
  },
  "title" : "CurrentValueSubject"
}
-->

# CurrentValueSubject

A subject that wraps a single value and publishes a new element whenever the value changes.

```
final class CurrentValueSubject<Output, Failure> where Failure : Error
```

## Overview

Unlike [`PassthroughSubject`](/documentation/Combine/PassthroughSubject), [`CurrentValueSubject`](/documentation/Combine/CurrentValueSubject) maintains a buffer of the most recently published element.

Calling [`send(_:)`](/documentation/Combine/Subject/send(_:)) on a [`CurrentValueSubject`](/documentation/Combine/CurrentValueSubject) also updates the current value, making it equivalent to updating the [`value`](/documentation/Combine/CurrentValueSubject/value) directly.

## Topics

### Creating a current value subject

[`init(_:)`](/documentation/Combine/CurrentValueSubject/init(_:))

Creates a current value subject with the given initial value.

### Accessing the current value

[`value`](/documentation/Combine/CurrentValueSubject/value)

The value wrapped by this subject, published as a new element whenever it changes.

## Relationships

### Conforms To

[`Subject`](/documentation/Combine/Subject)

[`Publisher`](/documentation/Combine/Publisher)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)