jkyeo / rxmoyamapperdemo Goto Github PK
View Code? Open in Web Editor NEWAn object mapper demo using Moya + RxSwift + SwiftyJSON
An object mapper demo using Moya + RxSwift + SwiftyJSON
Shouldn't provider be wrapped around another class or be some sort of singleton to be a safer design?
Also, what how would you recommend on designing the provider with JWT/Oauth authentication ?
这是我的ViewModel
正确的时候是没有问题的 但是如果错的话 就不会调用这个流了
init(){
let request = self.request.asObservable().flatMapLatest{ city -> Observable<Response> in
return self.apiProvider.request(.upload(cityname: city))
}.shareReplay(1)
let response = request.mapResponseToArray(type: ResultModel.self).shareReplay(1)
response.subscribe(onNext: { result in
self.backDate.value = result
}, onError: { error in
print(error)
}).addDisposableTo(disposeBag)
}
怎么区分 无网络 和是其他的error,看到请及时回复 谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.