RxSwift Xcoders Riga meetup

RxSwift Xcoders Riga meetup

6c9d1e82615877b0b2866f82cbf5f557?s=128

Kristaps Grinbergs

January 23, 2019
Tweet

Transcript

  1. RxSwift Introduction to reactive programming Kristaps Grinbergs @fassko

  2. RxSwift isn't KVO, ReactNative or ReactJS

  3. About me • Swift developer at Qminder • BCompSci &

    MComSci unfinished DmCompSci • > 15 years in IT • love open source
  4. None
  5. None
  6. Agenda • What is Rx • RxSwift and building blocks

    • Examples • Pros and Cons
  7. Imperative programming • Saved state • Order of execution •

    Side effects
  8. In computing, reactive programming is a programming paradigm oriented around

    data flows and the propagation of change. Wikipedia
  9. Reactive programming is programming with asynchronous data streams

  10. Reactive programming • Asynchronous • No saved state • Functional

    • Responsive
  11. ReactiveX An API for asynchronous programming with observable streams. •

    Microsoft (Rx.NET) - 2009 • Supports many languages • RxSwift - 2015
  12. Rx components • Observable • Observers • Schedulers

  13. None
  14. None
  15. None
  16. Observables Completed and Error will terminate the stream Next Completed

    Error
  17. Operators Filtering Transforming Combining

  18. None
  19. None
  20. RxMarbles.com

  21. None
  22. UI bindings RxCocoa

  23. None
  24. None
  25. None
  26. None
  27. Testing • Async XCTest with expectations • RxBlocking making it

    synchronous • Using RxTest and custom Schedulers • https://www.raywenderlich.com/7408-testing-your-rxswift-code • https://www.youtube.com/watch?v=FgbTenGH-P0
  28. + Agile and reusable code Thread safety Eliminate state from

    code Testing Well tested Error handling Large community and extensions Extends MVVM
  29. - Steep learning curve Change previous practices Debugging Testing Over-reactive

    Overhead
  30. None
  31. None
  32. Resources • http://reactivex.io/ • https://github.com/ReactiveX/RxSwift • https://github.com/RxSwiftCommunity • http://adamborek.com/ •

    http://rx-marin.com/ • RayWenderlich RxSwift book • Shai Michal presentations
  33. None