speaker: Vu Viet Tung
Introduction
When and When not to use it
Building blocks
Dynamic view
Reactivity
live at: least-power.tungv.com
Product Engineer at BodiData Inc.
playing with JavaScript in browser since 2005
working with JavaScript fullstack since 2012
FE: sammy, knockout, angular, react (thanks god! no backbone)
BE: express, meteor, redis, mongo, neo4j, amqp
Love to build web-scale apps and services
@tung__vu - github.com/tungv
goo.gl/JIvO2i
A pure function is a function that:
given a same set of params, always returns a same value
has no side effect
requires absolute immutability
Functional Frontend Architecture 101
images from css-tricks.com
Functional Frontend Architecture 101
images from css-tricks.com
Functional Frontend Architecture 101
Functional Frontend Architecture 101
Predictability
Reproducibility
Modularity
Testability
Is it for you?
In FFA, you must describe:
application state as plain objects and arrays.
changes in the system as plain objects.
the logic for handling changes as pure functions.
components in a declarative way
Is it for you?
Tell computer what the result should look like
You write expressions
Functions are mathematical functions
Tell computer how to achieve a result in steps
You write statements
Functions are coroutines
Is it for you?
or PPAP
building blocks
building blocks
building blocks
building blocks
building blocks
In real-life apps, view needs data to be transformed before being consumed. We need another pure function `S` that:
building blocks
Changes arrive in many forms:
But in general they are events.
dynamic view
In the formula we formed before:
The only way to change view, is to update the "array of actions" when an event occurs
dynamic view
dynamic view
dynamic view
the ultimate formula
the ultimate formula
bonus: reactivity
bonus: reactivity
bonus: reactivity
bonus: reactivity
❤️🙏❤️