jdisho / TinyNetworking

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

Cannot use map(to: ) in Combine #21

Closed ghost closed 4 years ago

ghost commented 4 years ago

When I use TinyNetworking with combine like the example. I cannot use the map(to:) to map the object. Screen Shot 2019-11-06 at 10 43 03 AM

asteiman commented 4 years ago

Any update on this?

jdisho commented 4 years ago

I will release an update soon.

But for now, if it helps, you can try this. Should be fine 😊

tinyNetworking
    .requestPublisher(resource: .photo(id: id))
    .compactMap { $0.data }
    .decode(type: Codable.Type, decoder: JSONDecoder())
    .eraseToAnyPublisher()
jdisho commented 4 years ago

Fixed. Released in v.4.0.1. 🚀