# \#passthroughsubject

**URL:** https://forums.swift.org/tag/passthroughsubject/405.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Combine: Best practices with memory management using subjects to publish values](https://forums.swift.org/t/combine-best-practices-with-memory-management-using-subjects-to-publish-values/38724)

<div class="topic-metadata">

**Author:** [@tourultimate](https://forums.swift.org/u/tourultimate)\
**Replies:** 4\
**Last updated:** [July 25, 2020, 3:44am UTC](https://forums.swift.org/t/combine-best-practices-with-memory-management-using-subjects-to-publish-values/38724 "2020-07-25T03:44:48Z")

</div>

Consider an object like this that publishes values via a subject: class IntStream { let subject = PassthroughSubject\<Int, Never\>() var publisher: AnyPublisher\<Int, Never\> { subject.eraseToAnyPublisher()…
