SlideShare a Scribd company logo
Cycling for noobs
cycleconf April 2016
Steve Lee
steve@opendirective.com
@SteveALee
Why CycleJS & RP?
• Background in embedded realtime
comms & early Windows
–Async messages, events, signals
• Result of review of client side tools
• Good components model
• Declarative code 
• Explicit data flow & transformation
Concerns
• Requires a “brain rewire”
• High barrier to reuse & contribution
• How do Progressive Enhancement?
• Slower initial development
• Are custom element tags clearer?
Still learning and testing
• But is looking promising so far
Quick Demo of Brian
• Designed for people with cognitive disabilities
– eg dementia or learning disabilities.
• Easy access to media and communications
• Various grades of UI complexity
– https://brian.opendirective.com
– https://brian.opendirective.com/assistant
– https://github.com/opendirective/brian
Initially RP feels like …
Leading to this …
Image: Remy by Stormy Peters
Drowning?
• Cycle opinionated use of Reactive frameworks
– All side effects in drivers
– Main made of pure function(s)
• Drivers are not complex– one liners are common
• Imagine flows splitting and joining (aka a
graph)
– Split: const stream2$ = stream1$
– Join .merge()
– Needs visualisation tools
– Play “Where’s my water” 
Brain aches
• State, state and state!
– Problem for imperative too; cycle brings clarity
– Externally persisted eg user settings
– DB via API (eg pouchdb)
– Scan or single atom?
– Is single atom as bad as global state?
• Higher order operators eg flatMap – XS helps
• How to map web app experience to RP
Resources
• Egghead.com – RxJS and CycleJS
• Staltz’s guide to Reactive Programming
– https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
• XStream
– http://staltz.com/xstream/
• RxMarbles
– http://rxmarbles.com/
• RxJS 5 docs: overview, operator selector
– http://reactivex.io
• RxJS 4 docs
– https://github.com/Reactive-Extensions/RxJS/tree/master/doc
Stop Press!
Stalz’s announcement of the XStream reactive
streams library for CycleJS means a good
number of the issues I hit have disappeared 0/
• http://staltz.com/xstream/
• http://staltz.com/why-we-built-xstream.html
XStream happiness
• Web apps use few of the many RxJS operators
– map, startWith, filter, merge, scan,
combineLatest, withLatestFrom,
mergeMap
• Hot vs cold, plus interaction with splitting
• Schedulers
• RxJS size on mobile
Debugging / testing
• http://staltz.com/how-to-debug-rxjs-code.html
• .do(x=>console.log(‘txt’, x))
• .subscribe(x=>console.log(‘txt’, x))
• Log all inputs and outputs (in production too)
• Unit test win with pure functions, less mocking
• ASCII Marble test descriptions 0/
• Global exception handler may be useful?
Relax, don’t sweat it
• This is RP with Observables, not full FRP
– Observable + iterator = streams
• No guilt - use non pure main function
• But, refactor out any code smells and anti
patterns as soon as possible. Pay your
Technical debt early
Hygge yourself happy
Wants
• Visualisation and debugging tools
• RxMarbles to cover higher order operators
• Examples of common idioms / patterns
• Repository of drivers
• Enhancing newbie on-boarding
Possible Bugs
• DOM driver seems to change capture/bubbling
– .do(preventPropagation()), cough
• No error event for img loading
– In line function handler with VDOM
• Extra click event on a removed node
– .filter(.parentElement !== null)
• Crazy bug with driver not getting item but added
subscribe does
• Reactivex.io docs for Observable.from missing
Cycle FTW

More Related Content

PDF
From Prototyping to Deployment at Scale with R and sparklyr with Kevin Kuo
PDF
Plug saiku
PPTX
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
PDF
Delivering Changes for Applications and Databases
PDF
Road to database automation: database source control
PDF
Road to database automation: database source control
PDF
Road to database automation - Database source control
PDF
J-Spring 2017 - Microservices in action at the Dutch National Police
From Prototyping to Deployment at Scale with R and sparklyr with Kevin Kuo
Plug saiku
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
Delivering Changes for Applications and Databases
Road to database automation: database source control
Road to database automation: database source control
Road to database automation - Database source control
J-Spring 2017 - Microservices in action at the Dutch National Police

What's hot (20)

PPTX
Splunk Quick Overview for Emirates Travel Hackathon
PPTX
Saving Time By Testing With Jest
PDF
Continuous Delivery Amsterdam - Microservices in action at the Dutch National...
PDF
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
PDF
Delivering changes for applications and databases
PPTX
SSIS Monitoring Deep Dive
PDF
Microservices: The Best Practices
PPTX
Do you queue
PPT
Next generation frontend tooling
PPTX
ASP.NET MVC - Latest & Greatest So Far
PPTX
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
PDF
Evolution of integration and microservices patterns with service mesh
PDF
Scala for java developers 6 may 2017 - yeni
PPTX
SQL Server 2016 Temporal Tables
PDF
Database Source Control: Migrations vs State
PDF
Database Source Control
PPTX
Minimum Viable Architecture - Good Enough is Good Enough
PDF
Haufe #msaday: "Building a Microservice Ecosystem"
PPTX
Rapid With Spring Roo
PDF
An introduction in to the world of front end automation - frontend ne (02 07-15)
Splunk Quick Overview for Emirates Travel Hackathon
Saving Time By Testing With Jest
Continuous Delivery Amsterdam - Microservices in action at the Dutch National...
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
Delivering changes for applications and databases
SSIS Monitoring Deep Dive
Microservices: The Best Practices
Do you queue
Next generation frontend tooling
ASP.NET MVC - Latest & Greatest So Far
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Evolution of integration and microservices patterns with service mesh
Scala for java developers 6 may 2017 - yeni
SQL Server 2016 Temporal Tables
Database Source Control: Migrations vs State
Database Source Control
Minimum Viable Architecture - Good Enough is Good Enough
Haufe #msaday: "Building a Microservice Ecosystem"
Rapid With Spring Roo
An introduction in to the world of front end automation - frontend ne (02 07-15)
Ad

Similar to Cycling for noobs (20)

PPTX
Getting Reactive with Cycle.js and xstream
PPTX
Getting Reactive with CycleJS and XStream
PDF
DZone_RC_RxJS
PDF
Rxjs In Action Covers Rxjs 5 1st Edition Paul P Daniels Luis Atencio
PPTX
Cycle.js overview
PPTX
Cycle.js a reactive framework
PPTX
Luis Atencio on RxJS
PPTX
RxJS and Reactive Programming - Modern Web UI - May 2015
PDF
Reactive programming with RxJS - Taiwan
PDF
Cycle.js: Functional and Reactive
PDF
My Gentle Introduction to RxJS
PPTX
Functional Reactive Programming (FRP): Working with RxJS
PDF
Reactive programming with cycle.js
PDF
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
PDF
Cycle.js - A functional reactive UI framework
PPTX
Functional Reactive Programming with RxJS
PDF
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27
PDF
Reactive programming and RxJS
PDF
Flow Base Programming with Node-RED and Functional Reactive Programming with ...
PPTX
RxJS In-Depth - AngularConnect 2015
Getting Reactive with Cycle.js and xstream
Getting Reactive with CycleJS and XStream
DZone_RC_RxJS
Rxjs In Action Covers Rxjs 5 1st Edition Paul P Daniels Luis Atencio
Cycle.js overview
Cycle.js a reactive framework
Luis Atencio on RxJS
RxJS and Reactive Programming - Modern Web UI - May 2015
Reactive programming with RxJS - Taiwan
Cycle.js: Functional and Reactive
My Gentle Introduction to RxJS
Functional Reactive Programming (FRP): Working with RxJS
Reactive programming with cycle.js
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - A functional reactive UI framework
Functional Reactive Programming with RxJS
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27
Reactive programming and RxJS
Flow Base Programming with Node-RED and Functional Reactive Programming with ...
RxJS In-Depth - AngularConnect 2015
Ad

More from Steve Lee (9)

PPTX
2017-09-15 T4I Maavis, son on Brian is Always in Mind
PPTX
2017 09-14 AAATE SteppingStones
PPTX
2016 11-28 t4-i_steppingstones
PPTX
2016-08-25 TechExeter - going serverless with Azure
PPTX
Module 2-web-a11y-steve lee
PPTX
10 min intro to web a11y
PDF
TS11 Community anti-patterns
ODP
Open accessibility – why is ‘open’ good for web accessibility?
ODP
Mobile a11y stack
2017-09-15 T4I Maavis, son on Brian is Always in Mind
2017 09-14 AAATE SteppingStones
2016 11-28 t4-i_steppingstones
2016-08-25 TechExeter - going serverless with Azure
Module 2-web-a11y-steve lee
10 min intro to web a11y
TS11 Community anti-patterns
Open accessibility – why is ‘open’ good for web accessibility?
Mobile a11y stack

Recently uploaded (20)

PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
history of c programming in notes for students .pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Transform Your Business with a Software ERP System
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
assetexplorer- product-overview - presentation
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Operating system designcfffgfgggggggvggggggggg
Wondershare Filmora 15 Crack With Activation Key [2025
history of c programming in notes for students .pptx
CHAPTER 2 - PM Management and IT Context
How to Migrate SBCGlobal Email to Yahoo Easily
Upgrade and Innovation Strategies for SAP ERP Customers
Transform Your Business with a Software ERP System
VVF-Customer-Presentation2025-Ver1.9.pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Which alternative to Crystal Reports is best for small or large businesses.pdf
Computer Software and OS of computer science of grade 11.pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
Softaken Excel to vCard Converter Software.pdf
assetexplorer- product-overview - presentation
Design an Analysis of Algorithms I-SECS-1021-03
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

Cycling for noobs

  • 1. Cycling for noobs cycleconf April 2016 Steve Lee steve@opendirective.com @SteveALee
  • 2. Why CycleJS & RP? • Background in embedded realtime comms & early Windows –Async messages, events, signals • Result of review of client side tools • Good components model • Declarative code  • Explicit data flow & transformation
  • 3. Concerns • Requires a “brain rewire” • High barrier to reuse & contribution • How do Progressive Enhancement? • Slower initial development • Are custom element tags clearer?
  • 4. Still learning and testing • But is looking promising so far
  • 5. Quick Demo of Brian • Designed for people with cognitive disabilities – eg dementia or learning disabilities. • Easy access to media and communications • Various grades of UI complexity – https://brian.opendirective.com – https://brian.opendirective.com/assistant – https://github.com/opendirective/brian
  • 7. Leading to this … Image: Remy by Stormy Peters
  • 8. Drowning? • Cycle opinionated use of Reactive frameworks – All side effects in drivers – Main made of pure function(s) • Drivers are not complex– one liners are common • Imagine flows splitting and joining (aka a graph) – Split: const stream2$ = stream1$ – Join .merge() – Needs visualisation tools – Play “Where’s my water” 
  • 9. Brain aches • State, state and state! – Problem for imperative too; cycle brings clarity – Externally persisted eg user settings – DB via API (eg pouchdb) – Scan or single atom? – Is single atom as bad as global state? • Higher order operators eg flatMap – XS helps • How to map web app experience to RP
  • 10. Resources • Egghead.com – RxJS and CycleJS • Staltz’s guide to Reactive Programming – https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 • XStream – http://staltz.com/xstream/ • RxMarbles – http://rxmarbles.com/ • RxJS 5 docs: overview, operator selector – http://reactivex.io • RxJS 4 docs – https://github.com/Reactive-Extensions/RxJS/tree/master/doc
  • 11. Stop Press! Stalz’s announcement of the XStream reactive streams library for CycleJS means a good number of the issues I hit have disappeared 0/ • http://staltz.com/xstream/ • http://staltz.com/why-we-built-xstream.html
  • 12. XStream happiness • Web apps use few of the many RxJS operators – map, startWith, filter, merge, scan, combineLatest, withLatestFrom, mergeMap • Hot vs cold, plus interaction with splitting • Schedulers • RxJS size on mobile
  • 13. Debugging / testing • http://staltz.com/how-to-debug-rxjs-code.html • .do(x=>console.log(‘txt’, x)) • .subscribe(x=>console.log(‘txt’, x)) • Log all inputs and outputs (in production too) • Unit test win with pure functions, less mocking • ASCII Marble test descriptions 0/ • Global exception handler may be useful?
  • 14. Relax, don’t sweat it • This is RP with Observables, not full FRP – Observable + iterator = streams • No guilt - use non pure main function • But, refactor out any code smells and anti patterns as soon as possible. Pay your Technical debt early
  • 16. Wants • Visualisation and debugging tools • RxMarbles to cover higher order operators • Examples of common idioms / patterns • Repository of drivers • Enhancing newbie on-boarding
  • 17. Possible Bugs • DOM driver seems to change capture/bubbling – .do(preventPropagation()), cough • No error event for img loading – In line function handler with VDOM • Extra click event on a removed node – .filter(.parentElement !== null) • Crazy bug with driver not getting item but added subscribe does • Reactivex.io docs for Observable.from missing

Editor's Notes

  • #2: OpenDirective = Rgardler + myself
  • #7: Disability – congenital or accident Age relate degeneration Situational disability
  • #8: Disability – congenital or accident Age relate degeneration Situational disability
  • #19: Disability – congenital or accident Age relate degeneration Situational disability