XUI
XUI copied to clipboard
Introduce @Publish<Modifier> resultBuilder to create Combine Publisher
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())
}
}