RAS S1E4

Flatmap is one of those ubiquitous operators that, independently of your expertise level, will be present in your day-to-day work with ReactiveSwift. In this post I will talk about how we can leverage its strategies with an example. If you are not familiar with them: latest race merge concact concurrent[…

map versus flatMap

Note: The goal of this post is to give the reader an intuition about the usage of a map versus a flatMap, instead of playing around with return types of each operation, until you pick the one that suits. A recurring topic during our interview process is "what's the…

RAS S1E2

A tale of composition 🌳 In my mind there are two ways of thinking about composition, when we have FRP or FP in the mix. The first one is often mentioned when compared to inheritance[1]: Composition over inheritance in object-oriented programming is the principle that classes should achieve polymorphic behaviour…

Cakes and ViewModels

A talk that I think went fairly unnoticed, by Jon Sterling, entitled "Modularity à la Taliban" stated the following: A ViewModel should only be created by another ViewModel. [1] With this idea in mind, let's see it in practise[1:1]: User tries to login via Facebook. Has…

Younger self

What I wish I could tell my younger self about FRP (from a RAC perspective): Before diving into FRP, start using functional aspects that Swift gives you for free. Like: map, flatMap, filter, reduce, or create your own. This will make the usage of high order functions more intuitive. Without…

Why FRP?

So today I wrote this on Twitter: People still think that Reactive libs/frameworks are just an enhanced KVO. #2016— Rui Peres (@peres) January 7, 2016 Part 1 And I got some feedback from Miguel Ferreira. Since, in general, I agree with his opinions about software development, I decided…

Schedulers

When you think about ReactiveCocoa, one immediately thinks about Signals, streams of events and transformations. Although that's all there, RAC is more than meets the eye. Lately I had to do the following: Track if a user spends more than 2 seconds in a screen. I went with viewDidAppear: and…