jdisho / TinyNetworking

🌩 Simple HTTP network abstraction layer written in Swift
MIT License
145 stars 13 forks source link

Support Combine #19

Closed jdisho closed 4 years ago

jdisho commented 4 years ago

In this PR, I add support for the Combine version.

How to use:

let tn = TinyNetworking<SomeAPI>()

...

tinyNetworking
    .requestPublisher(resource: .photos))
    .sink(receiveCompletion: { _ in }) { response in
        let str = String(decoding: response.data, as: UTF8.self)
        print(str)
     }