SlideShare a Scribd company logo
Keep your side-effects 
in the right place with 
redux observable
Keep your side-effects 

in the right place with 

redux-observable
a ngParty Regular meetup XIV talk
$whoami
Viliam Elischer
SW Engineer at
twitter.com/vireliam
github.com/vire
github.com/ngParty
Agenda
Tackle the side-effects
State of art
Redux-observable
Demo
Why bother with side-effects?
Because side-effects in
codebase might* lead to:
development slow-down

non-determinism a.k.a. bugs

hard maintenance

on-boarding
Keep your side-effects 
in the right place with 
redux observable
official react docs
KPIs for dealing with

side-effects?
1. How painful is adding new features
2. API - developer’s experience
3. Testability
4. Maintainability / Refactoring
5. Documentation
State of the art
for libs handling side-effects in redux* applications
#1 redux-thunk
A thunk is a function that wraps an expression to delay its
evaluation.
Keep your side-effects 
in the right place with 
redux observable
Keep your side-effects 
in the right place with 
redux observable
Pros / Cons
(+) Easy, simple, good for beginners
(+) Good enough for small project
(+) Documentation / part of redux
(-) Complexity grows quickly (promises, dispatches)
(-) Harder to test
(-) Business logic in action creators
(-) Custom utilities - cancelation, debounce, throttle, retry
exhaustive SO explanation on redux-thunk
#2 Effect executors
Store (state, effects)

Reducers (state, action, effects) 

Dispatch(action, effect)

Middleware(store, executor)
Keep your side-effects 
in the right place with 
redux observable
#2A redux-effects*
Not maintained anymore, complex & complicated
#2B redux-side-effect
Execute side effects from reducer function
Keep your side-effects 
in the right place with 
redux observable
Pros / Cons
(+) Easy to test*
(+) Sync action creators
(-) Hard to maintain
(-) Race conditions (setTimeout required)
(-) Action creators bloated wit SE logic
(-) Custom utilities - cancelation, debounce,
throttle, retry
* based on visual opinion
#3 salsita/redux-side-effects
“What if your reducers were generators? You could yield side
effects and return application state.”
Keep your side-effects 
in the right place with 
redux observable
Pros / Cons
(+) Declarative side effects / yield in
reducer
(+) Easy to test
(+) Documentation
(-) Generators (available under flag)
(-) Custom utilities - cancelation,
debounce, throttle, retry
#4 redux-saga
“The mental model is that a saga is like a separate thread in
your application that's solely responsible for side effects.”
official docs
Keep your side-effects 
in the right place with 
redux observable
Keep your side-effects 
in the right place with 
redux observable
Keep your side-effects 
in the right place with 
redux observable
Knowledge of generators concept required
Pros / Cons
(+) Mature
(+) Easy to test
(+) Documentation
(+) Custom utilities - cancelation, debounce,
throttle, retry
(o) Generators
(-) Ease of use
(-) Complexity
#4 redux-observable
“RxJS 5-based middleware for Redux. Compose and cancel
async actions to create side effects and more.”

official docs
Epic
core primitive of redux-observable.
a function which takes a stream of actions
and returns a stream of actions.
actions in, actions out.
Example
Implementation
Keep your side-effects 
in the right place with 
redux observable
Keep your side-effects 
in the right place with 
redux observable
Implementation
Demo
Q&A
Thank you!

@vireliam

#devsUnited
A. Sharif
Generators and Channels in JavaScript

More Related Content

PDF
Alexey Kupriyanenko "Release Early, Often, Stable"
PDF
No more video loss - Alex Rivkin, Motorola Solutions
PPTX
Beyond Continuous Delivery at ThoughtWorks North America Away Day
PPT
Maven 2 - more than a build tool
PPTX
Beyond Continuous Delivery TW Away Day June 2013
PDF
RxJS101 - What you need to know to get started with RxJS tomorrow
PDF
Ember.js - Jak zatopit a neshořet!
PPTX
Vývojařská Plzeň - React
Alexey Kupriyanenko "Release Early, Often, Stable"
No more video loss - Alex Rivkin, Motorola Solutions
Beyond Continuous Delivery at ThoughtWorks North America Away Day
Maven 2 - more than a build tool
Beyond Continuous Delivery TW Away Day June 2013
RxJS101 - What you need to know to get started with RxJS tomorrow
Ember.js - Jak zatopit a neshořet!
Vývojařská Plzeň - React

Viewers also liked (9)

PPTX
Taming Asynchrony using RxJS
PDF
RxJS - The Reactive extensions for JavaScript
PPTX
Async Redux Actions With RxJS - React Rally 2016
PDF
RxJS - The Reactive Extensions for JavaScript
PDF
Compose Async with RxJS
PDF
RxJS + Redux + React = Amazing
PPTX
Functional Reactive Programming with RxJS
PPTX
RxJS and Reactive Programming - Modern Web UI - May 2015
PPTX
26 Disruptive & Technology Trends 2016 - 2018
Taming Asynchrony using RxJS
RxJS - The Reactive extensions for JavaScript
Async Redux Actions With RxJS - React Rally 2016
RxJS - The Reactive Extensions for JavaScript
Compose Async with RxJS
RxJS + Redux + React = Amazing
Functional Reactive Programming with RxJS
RxJS and Reactive Programming - Modern Web UI - May 2015
26 Disruptive & Technology Trends 2016 - 2018
Ad

Similar to Keep your side-effects 
in the right place with 
redux observable (20)

PPTX
React gsg presentation with ryan jung & elias malik
PPTX
an Introduction to Redux
PDF
Redux-Saga: managing side effects and impure stuff
PDF
Side effects-con-redux
PDF
Effects, Coeffects & Subscriptions: a pit of success for SPAs
PPTX
Modular development with redux
PDF
Sagas Middleware Architecture
PDF
The evolution of redux action creators
PPTX
U3-02-React Redux and MUI.pptxaSDFGNXDASDFG
PPTX
Maintaining sanity in a large redux app
PDF
Effects, coeffects & subscriptions: a pit of success for SPAs Socracan18
PDF
How to Redux
PDF
A React Journey
PPTX
7 Redux challenges
PDF
Redux js
PPTX
Redux workshop
PDF
Predictable reactive state management - ngrx
PPTX
STATE MANAGEMENT IN REACT [Autosaved].pptx
PDF
The Road To Redux
PPTX
React / Redux Architectures
React gsg presentation with ryan jung & elias malik
an Introduction to Redux
Redux-Saga: managing side effects and impure stuff
Side effects-con-redux
Effects, Coeffects & Subscriptions: a pit of success for SPAs
Modular development with redux
Sagas Middleware Architecture
The evolution of redux action creators
U3-02-React Redux and MUI.pptxaSDFGNXDASDFG
Maintaining sanity in a large redux app
Effects, coeffects & subscriptions: a pit of success for SPAs Socracan18
How to Redux
A React Journey
7 Redux challenges
Redux js
Redux workshop
Predictable reactive state management - ngrx
STATE MANAGEMENT IN REACT [Autosaved].pptx
The Road To Redux
React / Redux Architectures
Ad

Recently uploaded (20)

PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPT
Project quality management in manufacturing
PPTX
Sustainable Sites - Green Building Construction
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPT
introduction to datamining and warehousing
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Safety Seminar civil to be ensured for safe working.
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Artificial Intelligence
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Project quality management in manufacturing
Sustainable Sites - Green Building Construction
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
introduction to datamining and warehousing
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Internet of Things (IOT) - A guide to understanding
UNIT 4 Total Quality Management .pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Foundation to blockchain - A guide to Blockchain Tech
Safety Seminar civil to be ensured for safe working.
Mechanical Engineering MATERIALS Selection
Artificial Intelligence

Keep your side-effects 
in the right place with 
redux observable