Skip to content

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

License

Notifications You must be signed in to change notification settings

AbdAlAlii/ReplayLatest

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages