ReactJS + FRP:
Using Functional Reactive Programming to replace Flux

Uriel Avalos

Pure Functions

What is Functional Reactive Programming?

Understanding FRP

#reduce/scan


//
//                current
//                value
//                |
[1, 2, 3, 4, 5] //|
  .reduce((total, x) => total + x, 0)
//           ^                     ^
//      accumulator             start
            

inputStream
  .map(x => x.toUpperCase())
  .onValue(x => this.setState({x}))
            

State in FRP?

One-Way Data Flow

Action Functions

Immutability

Complex Actions && SideEffects

Complex SideEffects?