/ReplayLatest

A publisher to share the most recent received values upon subscription.

Primary LanguageSwiftMIT LicenseMIT

ReplayLatest

ReplayLatest simplifies sharing and receiving the most recent values immediately upon subscription.

Usage

Import

Import ReplayLatest into your files:

import ReplayLatest

Implementation

Use the operator in your publisher chain declaration:

let subject = PassthroughSubject<Int, Never>()
let publisher = subject.replayLatest(capacity: 2)

Debugging

ReplayLatest includes a built-in printSink() operator for easy debugging without additional subscribers:

Just("value").printSink()

Installation

Add ReplayLatest to your dependencies:

dependencies: [
	.package(url: "https://github.com/AbdAlAlii/ReplayLatest.git")
]

License

ReplayLatest is licensed under the MIT License. See the LICENSE file for more information.