Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RxJava at Freeletics

RxJava at Freeletics

How we use RxJava at Freeletics and why we like it

Dmytro Khmelenko

November 03, 2016

Transcript

13 slides
  1. REACTIVE EXTENSION It’s a library for composing asynchronous and event-

    based programs by using observable sequences. 2
  2. GET FUNCTIONAL - avoid changing state - avoid mutable data

    - declarative expression instead of statement - computation as the evaluation of math function 3
  3. BEFORE 4 private Product getProduct() throws IOException, JSONException {
 AssetSource

    assets = new AssetSource(context, "product_1_month.json");
 String productJson = assets.asCharSource(Charsets.UTF_8).read();
 return new Product(productJson);
 }
 
 private void handleProduct() {
 Product product = null;
 try {
 product = getProduct();
 } catch (IOException | JSONException e) {
 e.printStackTrace();
 }
 
 if(product != null) {
 String interval = product.interval();
 //...
 }
 }

More Decks by Dmytro Khmelenko

Other Decks in Programming