Initial Commit
The ReplayLatest makes it simple for subscribers to share and receive the most recent values immediately upon subscription.
Ensure to import ReplayLatest in each file you wish to have access to the utility.
The operators can then be used as part of your usual publisher chain declaration:
let subject = PassthroughSubject<Int, Never>() let publisher = subject.replayLatest(capacity: 2)
ReplayLatest has a built-in printSink() operator that you can use to debug a subscription without the need to add a separate subscriber like so:
Just("value").printSink()
Swift Package Manager:
dependencies: [ .package(url: "https://github.com/abdalaliii/ReplayLatest.git") ]
This whole project is a work in progress, a learning exercise.
ReplayLatest is available under the MIT license. See the LICENSE file for more info.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
ReplayLatest
The ReplayLatest makes it simple for subscribers to share and receive the most recent values immediately upon subscription.
Usage
Ensure to import ReplayLatest in each file you wish to have access to the utility.
The operators can then be used as part of your usual publisher chain declaration:
Debugging
ReplayLatest has a built-in printSink() operator that you can use to debug a subscription without the need to add a separate subscriber like so:
Installation
Swift Package Manager:
Developer Notes
This whole project is a work in progress, a learning exercise.
License
ReplayLatest is available under the MIT license. See the LICENSE file for more info.