XUI icon indicating copy to clipboard operation
XUI copied to clipboard

Introduce @Publish<Modifier> resultBuilder to create Combine Publisher

Open pauljohanneskraft opened this issue 4 years ago • 0 comments

This change introduces a new result builder to allow for the simple creation of reactive APIs.

One will be able to create publishers using the following:

@Publish<MainQueue>
func fetchProject(name: String) -> Pipeline<Project> {
    if let project = cache[name] {
        project
    } else {
        URLSession.shared.dataTaskPublisher(for: request)
            .map(\.data)
            .decode(Project.self, from: JSONDecoder())
    }
}

pauljohanneskraft avatar May 04 '21 14:05 pauljohanneskraft