Skip to content

extension and demo project that adds asPublisher() -> AnyPublisher<Element, Error>

Notifications You must be signed in to change notification settings

Macmee/RxSwift-asPublisher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

As Combine and SwiftUI both mature, projects that want to embrace these frameworks may need to bridge between RxSwift Observables and Combine Publishers. This repository adds such a bridge by adding an asPublisher() extension onto ObservableConvertibleType.

  1. The problem: You're building a reddit client that shows a feed of /r/pics posts, and you have an postsObservable RxObservable of type Observable<[RedditPost]>
  2. you have a SwiftUI component SubredditView(redditFeed:) where redditFeed is expected to be a Combine Publisher
  3. you can now create your component using SubredditView(redditFeed: postsObservable.asPublisher())

NOTE: Source code for this project lives in the Shared/ folder.

demo

About

extension and demo project that adds asPublisher() -> AnyPublisher<Element, Error>

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published