SlideShare a Scribd company logo
Robust UI development
with ClojureScript
– http://redux.js.org/docs/introduction/Motivation.html
“As the requirements for JavaScript single-page
applications have become increasingly
complicated, our code must manage more
state than ever before.”
Robust UI development with ClojureScript
A user interface is a
giant blob of state
Robust UI development with ClojureScript
ClojureScript
• first-class immutability and persistent data
structures
• think carefully about state
• is a lisp!
Rapid Primer
Vectors
Maps
Robust UI development with ClojureScript
Atoms: Represent Mutable
State
Robust UI development with ClojureScript
view = f(state)
changeschanges with the
state
constant (you wrote it)
reagent: view as a function of data
reagent: separate state and
views using atoms
constantchanges because f is
changing
changes (you’re writing it)
view = f(state)
Hot code reloading
• change view as you type, but maintain state
• enables rapid feedback cycles
• how do we make this work?
• change only f, not s: this means we need to
separate f from s
• ClojureScript and reagent already do this!
*figwheel demo*
Demonstrate how figwheel can reload code
while maintaining state
This is cool! But…
We need to control mutation
and side effects
• our state is in multiple atoms
• our side effects are in event handlers scattered
throughout the code
• how can we make mutation and side effects more
predictable?
re-frame: state container
and application architecture
• put state all in one place: the re-frame DB
• Events: “something happened”
• event handlers return Effects — a data description
of side effects to be performed
• Effect Handlers perform the side effects
• Query the state in our views using Subscriptions
re-frame redux + libraries
events actions
subscriptions reselect
effects redux-saga
Robust UI development with ClojureScript
Ensuring consistency of
state with clojure.spec
• a system for specifying data as a composition of
predicates
• it is not a type system
• allows runtime data validation, documentation, test
data generation and generative testing
• we are only interested in data validation for now
• validate the state after every change, and fail
loudly if the state is invalid
• spec also provides useful error messages
• since spec validates at runtime, we can perform
more interesting validations
*demo of spec
validation with re-frame*
Demonstrate specifying the application state
with spec and the failure and error message
when our code tries to put the application into
an invalid state

More Related Content

PDF
PPTX
Getting started with react & redux
PPTX
Introduction to react js
PDF
React: High level overview for backend developers
PDF
An introduction to React.js
PPTX
Introduction to React JS for beginners
PPTX
Dependency Inversion in large-scale TypeScript applications with InversifyJS
PDF
React.js+Redux Workshops
Getting started with react & redux
Introduction to react js
React: High level overview for backend developers
An introduction to React.js
Introduction to React JS for beginners
Dependency Inversion in large-scale TypeScript applications with InversifyJS
React.js+Redux Workshops

What's hot (20)

PPTX
Intro to React
PDF
Akka - Developing SEDA Based Applications
PDF
Introduction to React, Flux, and Isomorphic Apps
PDF
Understanding Facebook's React.js
PPTX
A Brief Introduction to React.js
PDF
React and redux
PDF
Introduction to react
PDF
Robust web apps with React.js
PPT
React js
PPSX
React introduction
PDF
How to Redux
PDF
GITS Class #19: Build Large Scale Vue.js Apps with Vuex
PPTX
React js
PPTX
The Benefits of Using React JS for Web Development!
PDF
GITS Class #20: Building A Fast and Responsive UI in React Native
PPTX
Getting started with Redux js
PDF
React JS - Introduction
PPTX
Introduction to React JS for beginners | Namespace IT
PDF
Event streams all the way down
PPTX
React js Rahil Memon
Intro to React
Akka - Developing SEDA Based Applications
Introduction to React, Flux, and Isomorphic Apps
Understanding Facebook's React.js
A Brief Introduction to React.js
React and redux
Introduction to react
Robust web apps with React.js
React js
React introduction
How to Redux
GITS Class #19: Build Large Scale Vue.js Apps with Vuex
React js
The Benefits of Using React JS for Web Development!
GITS Class #20: Building A Fast and Responsive UI in React Native
Getting started with Redux js
React JS - Introduction
Introduction to React JS for beginners | Namespace IT
Event streams all the way down
React js Rahil Memon
Ad

Similar to Robust UI development with ClojureScript (20)

PPTX
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
PDF
Meteor + React
PPTX
reactJS
PDF
2018 02-22 React, Redux & Building Applications that Scale | React
PPTX
React + Redux + TypeScript === ♥
PPTX
React gsg presentation with ryan jung & elias malik
PPTX
[Final] ReactJS presentation
PPT
Architectural peripherals of react by Vadym Zhiltsov
PPTX
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
PDF
React.js and Redux overview
PPTX
Reactjs
PDF
Redux essentials
PPTX
A load balancing model based on cloud partitioning for the public cloud. ppt
PDF
Introduction Web Development using ReactJS
PPTX
ReactJS presentation.pptx
PPTX
Comparing Angular and React JS for SPAs
PDF
PPTX
STATE MANAGEMENT IN REACT [Autosaved].pptx
PDF
3 Reasons to Love React
PPTX
unit 2 Mastering-State-Management-in-React.pptx
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Meteor + React
reactJS
2018 02-22 React, Redux & Building Applications that Scale | React
React + Redux + TypeScript === ♥
React gsg presentation with ryan jung & elias malik
[Final] ReactJS presentation
Architectural peripherals of react by Vadym Zhiltsov
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
React.js and Redux overview
Reactjs
Redux essentials
A load balancing model based on cloud partitioning for the public cloud. ppt
Introduction Web Development using ReactJS
ReactJS presentation.pptx
Comparing Angular and React JS for SPAs
STATE MANAGEMENT IN REACT [Autosaved].pptx
3 Reasons to Love React
unit 2 Mastering-State-Management-in-React.pptx
Ad

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Transform Your Business with a Software ERP System
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Digital Strategies for Manufacturing Companies
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
medical staffing services at VALiNTRY
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
top salesforce developer skills in 2025.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Transform Your Business with a Software ERP System
ISO 45001 Occupational Health and Safety Management System
Navsoft: AI-Powered Business Solutions & Custom Software Development
Digital Strategies for Manufacturing Companies
How Creative Agencies Leverage Project Management Software.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
medical staffing services at VALiNTRY
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PTS Company Brochure 2025 (1).pdf.......
Odoo Companies in India – Driving Business Transformation.pdf
L1 - Introduction to python Backend.pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
How to Migrate SBCGlobal Email to Yahoo Easily
Understanding Forklifts - TECH EHS Solution
Design an Analysis of Algorithms I-SECS-1021-03
Odoo POS Development Services by CandidRoot Solutions
top salesforce developer skills in 2025.pdf

Robust UI development with ClojureScript