railwaymen / restler

Make simple API request using functional programming
MIT License
2 stars 3 forks source link

Change interface of requests #44

Closed sprzenus closed 4 years ago

sprzenus commented 4 years ago

After .decode(SomeType.self) now we are providing handlers and then start the request like this:

.onSuccess { object in print(object) }
.onCompletion { result in print(result) }
.start()

I want to shorten it to this (inspired by RxSwift):

.subscribe(
  onSuccess: { object in print(object) },
  onCompletion: { result in pring(result) })