Swiftpack.co - artem-y/combineer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by artem-y.
artem-y/combineer 0.1.1
Helpers to use with Combine framework.
⭐️ 0
🕓 1 week ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/artem-y/combineer.git", from: "0.1.1")

Combineer

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.

What's included

BindingObject

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.

GitHub

link
Stars: 0
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics