How do you do
that in FRP?
@_bondit_Netta Bondy
What is FRP?
Functional reactive programming (FRP) is a
programming paradigm for reactive programming
using the building blocks of functional programming
wikipedia.org
Reactive Programming
reactive programming is a declarative programming
paradigm concerned with data streams and the
propagation of change
wikipedia.org
Streams = Observables
1
Observable / stream
UI component
UI component
UI component
1
1
1
Functional Programming
functional programming is a programming paradigm
that treats computation as the evaluation of
mathematical functions and avoids changing-state
and mutable data
wikipedia.org
Pure Functions =
Operators
16
random
int
UI component
^2 filter odd
Observable
Operators
State (??)
ButtonSelected ButtonButtonSelected Button
isNotSelected
click
isSelected
click
isNotSelected
isNotSelected isSelected isNotSelected
State = Subjects
initalFilters
click
newFilters
click
newFilters
initialFilters newFilters newFilters
State = Subjects
Streams of Streams:
Higher Order Operators
Map operator
stream new stream.map()
Higher order mapping operator
mergeMap
switchMap
switchMap
switchMap(click → request → response)
click clickclickclick click
response responseresponse
switchMap(click → request → response)
+blue -gray+gray
response response
The FRP Learning Curve
Pays Off
Thank You!
1st example
2nd example
@_bondit_

How do you do that in FRP