Damian Esteban
BetterPT engineering
1 min readApr 22, 2018

--

This is an excellent approach to handling interactions with APIs (or databases, queues, etc.) I follow a similar pattern when creating Services for my applications. Have you considered using RxJS? I think it would compliment the way you handle different states and events nicely. Maybe take a look at Moya (a fantastic library for writing an API layer in Swift) for inspiration.

--

--

Damian Esteban
BetterPT engineering

CTO @ BHC. Solutions Architect, iOS / JavaScript developer in NYC. Avid Unix user, all-around geek. Proud of it. http://blog.damianesteban.dev