Lightweight collection of helpers and tools to make working with Apple's Combine framework more convenient and decrease the amount of Combine-related boilerplate code.
Please feel free to request some nice-to-have features or point out the things that need improvement.
Class-bound protocol that provides bind
methods to use instead of the standard sink
+store
to make call sites cleaner.
For example, instead of this
somePublisher
.sink { [weak self] value in
self?.doSomething(with: value)
}
.store(in: cancellables)
objects that conform to BindingObject
can now bind the received value as follows:
bind(somePublisher) { [weak self] value in
self?.doSomething(with: value)
}
bindOnMainQueue
accomplishes the same but receives on the DispatchQueue.main
scheduler.
bind(_:, to:)
and bindOnMainQueue(_:, to:)
methods allow passing the value of a publisher to a subject:
bind(myPublisher, to: mySubject)
link |
Stars: 1 |
Last commit: 28 weeks ago |
Full Changelog: https://github.com/artem-y/combineer/compare/v0.1.1...v0.2.0
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics