---
title: CurrentValueSubject
framework: combine
role: symbol
role_heading: Class
path: combine/currentvaluesubject
---

# CurrentValueSubject

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

## Declaration

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

## Mentioned in

Using Combine for Your App’s Asynchronous Code

## Overview

Overview Unlike PassthroughSubject, CurrentValueSubject maintains a buffer of the most recently published element. Calling send(_:) on a CurrentValueSubject also updates the current value, making it equivalent to updating the value directly.

## Topics

### Creating a current value subject

- [init(_:)](combine/currentvaluesubject/init(_:).md)

### Accessing the current value

- [value](combine/currentvaluesubject/value.md)

## Relationships

### Conforms To

- [Publisher](combine/publisher.md)
- [Subject](combine/subject.md)

## See Also

### Subjects

- [Subject](combine/subject.md)
- [PassthroughSubject](combine/passthroughsubject.md)
