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

今日こそ理解するHot / Cold @社内RxSwift勉強会

今日こそ理解するHot / Cold @社内RxSwift勉強会

ukitaka

July 18, 2016
Tweet

More Decks by ukitaka

Other Decks in Programming

Transcript

  1. Hot / Cold • Hot / Cold Ή͔͍ͣ͠ • Hot

    / Cold Α͘Θ͔Βͳ͍ • Hot / Cold ཧղͰ͖ͳ͍ • Rx೉ͦ͠͏… Rxා͍…
  2. ͜ͷεϥΠυͰ͸ • ྫ (ΫΠζ) Λग़͠ͳ͕ΒHot / Cold ͦΕͧΕ ͕ͲΜͳੑ࣭Λ͍࣋ͬͯΔͷ͔֬ೝ͍͖ͯ͠ ·͢ɻ

    • ·ͩͦΕͧΕͷੑ࣭΍ҧ͍Λઆ໌͍ͯ͠ͳ͍ ͷͰ͕͢ɺ͋ͱͰઆ໌͠΍͘͢͢ΔͨΊʹ࠷ ॳʹʮલఏ஌ࣝʯͱʮݟ෼͚ํʯͷϧʔϧΛ આ໌͠·͢ɻ
  3. ͡Ό͋ͳʹ͕Observable͔ • Subject • PublishSubject, BehaviorSubject, ReplaySubject … • Operator

    ← !? • map, filter, flatMap … • create, of, just, error …
  4. ෼ذͰ͖Δͱ͸ʁ • ෼ذͰ͖Δ = ObserverΛෳ਺࣋ͯΔ • Cold ͳObservable͸ObserverΛ1͔ͭ࣋ͯ͠ͳ͍ • Hot

    ͳObservable͸ObserverΛෳ਺࣋ͯΔ ※ આ໌؆ུԽͷͨΊʹʮObserverʯͱ͍ͯ͠·͕͢ɺ΋ͪΖΜ͜͜· ͰͷྫͷΑ͏ʹ෼ذޙʹObservableΛͭͳ͛ͯߦ͘͜ͱ΋Ͱ͖·͢ɻ