Swiftpack.co -  BlueEventHorizon/BwPublisher as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
BlueEventHorizon/BwPublisher
PPublisher is the light weight publish/subscribe library
.package(url: "https://github.com/BlueEventHorizon/BwPublisher.git", from: "2.0.5")

BwPublisher

BwPublisher is the light weight publish/subscribe library.

This library can be used for the purpose of operating loosely coupled between software layers like RxSwift and Combine Framework. It's very lightweight and consumes little memory, as only the minimum amount of observing functionality is implemented. It is suitable for use in apps with limited memory, such as App Clips introduced from iOS14.

Usage

it is very easy to use BwPublisher

Publisher


class Hoge {
    var publisher = Publisher<String>()
    
    func action() {
        publisher.publish("Hoge Updated")
    }
}

Subscriber


class Fuga {

    let hoge = Hoge()
    var bag = SubscriptionBag()
    
    ... invoke configure() at somwhere ...
    
    func configure() {
        hoge.publisher.subscribe.subscribe(self) { [weak self] message in
            print(message)
        }
        .unsubscribed(by: bag)
    }
}

GitHub

link
Stars: 2
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Update README
1 year ago

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