#Flux as a #StateSpaceModel of user interactions and #LocalStorage options for #WebBrowsers
Posted on August 11th, 2015
In the first talk, Taylor Hakes gave an introduction to Flux, an approach to organizing web development. Taylor spoke about the problems of purely programming the dom. One is that user interactions can be conceptualized by creating models in the virtual dom, but the two-way interactions between models and the UI offers little structure and the possibility of a complex web of interactions. For example, a user input can trigger many outcomes that may be hard to conceptualize or debug.
He then offered a view in which user interactions flow through a single dispatcher that coordinates all action requests, updates a state space, which in turn drives views. User interactions are routed through action requests, which then restart the state space update process coordinated by the dispatcher.
Taylor presented code examples showing that
- Actions are now functions
- The history of interactions is stored in state variables
- Debugging is easier since the state variables can be monitored vs. the user actions
- Flux is verbose, but useful when the logic is complex, but the number of states is manageable
- React complements Flux
To learn more, Taylor recommended the book: Evaluation of Flux Frameworks – by Dan Abramov
In the second talk, Geraldina Alvarez Garcia @Kickstarter discussed methods for storing data from a web browser on the local computer. The four methods are
- Local key-value store
- Session storage
Cookies are the most prevalent form of local storages, but they are limited to 4k of information. Geraldina talked about an application needing more storage and showed a code snippet implementing a key-value store. It can store up to 5MB of data, but cannot transfer the data directly to a server and is a synchronous operation which may interfere with other operations such as real-time interactive video.