Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Better async redux saga
Search
Kushan Joshi
June 28, 2017
Technology
760
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Better async redux saga
Slides on Generator Functions and Redux Saga
Kushan Joshi
June 28, 2017
Other Decks in Technology
See All in Technology
エージェントはローカル、検証はMicroVM — Lambda MicroVMsでつくるServerless CI
fujioka6789
3
180
開発投資の期待値を上げるプロダクトロードマップづくり ~プロダクトエンジニアが越境して事業を伸ばす~
kekekenta
1
200
積み重なった技術負債への挑戦 〜初手としての全社ゴト化〜
techtekt
PRO
0
1.3k
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
360
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
740
ユーザー価値を届け続けるためにウォンテッドリーが大切にしている文化
kotaminato
0
170
おい、エージェントを使って終わらせろ
nwiizo
1
620
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
120
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
2
550
Reactの設計論
uhyo
24
13k
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.9k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Why Our Code Smells
bkeepers
PRO
340
58k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
エンジニアに許された特別な時間の終わり
watany
109
250k
Tell your own story through comics
letsgokoyo
1
1.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Transcript
GENERATORS REDUX SAGA & Kushan Joshi
KUSHAN JOSHI Mapbox OpenStreetMap @kushan2020
GENERATORS What are Generator Functions ? Are functions that can
hold state They can be paused / resumed on demand.
GENERATORS Unlike functions, Generator functions do not run to completion
"
GENERATORS Should I run?
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS EXAMPLE is called an iterator
ITERABLE
ITERABLE
ITERABLE
GENERATORS Built in iterables Array, String, Map, Set, TypedArray
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS EXAMPLE
GENERATORS What are generators, again ? Give you a nice
way to generate an Iterator
GENERATORS Great! Let us look at Redux
REDUX PROBLEM Store ✈ Action
REDUX PROBLEM Store ✈ ✈ ✈ ✈ ✈ Actions
REDUX PROBLEM Store Async Actions? Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store There are a lot of tools to
solve this problem. Async-Action
REDUX PROBLEM Store Async-Action Easy bro!
REDUX PROBLEM Store Async-Action One of them is Redux Saga
REDUX SAGA Is a library which helps manage async actions
with generators. 5 Redux Saga
REDUX SAGA It runs the generator functions for you.
It gives you helper functions to interact with Redux
REDUX SAGA ✈
REDUX SAGA ✈
REDUX SAGA
REDUX SAGA
GENERATORS How does it compare with Redux Thunks Nice!
REDUX THUNKS LOGIN WITH THUNKS
REDUX THUNKS LOGIN WITH THUNKS
REDUX THUNKS LOGIN WITH THUNKS
REDUX THUNKS LOGIN WITH THUNKS
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
THUNKS FEATURE PARITY WITH THUNKS
GENERATORS Isn’t this just too complex for a login
THUNKS
THUNKS FEATURE PARITY WITH THUNKS
NETWORK RACE
NETWORK RACE
NETWORK RACE
NETWORK RACE
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA ✈ Logout!
SAGA LOGIN WITH SAGA Me?
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
SAGA LOGIN WITH SAGA
GENERATORS Can’t you just use Async / Await and be
happy?
SAGA ASYNC AWAIT IMPLEMENTATION OF REDUX SAGA
SAGA ASYNC AWAIT IMPLEMENTATION OF REDUX SAGA
GENERATORS So, are generators useless?
GENERATORS The whole point of generators is that you can
manipulate them while they are suspended.
GENERATORS Think of it as a conversation between the code
that runs the generator and the generator itself. Generator Redux Saga (runner)
GENERATORS Generator Redux Saga (runner)
GENERATORS Generator Redux Saga (runner)
GENERATORS Generator Redux Saga (runner)
GENERATORS Generator Redux Saga (runner)
GENERATORS Generator Redux Saga (runner)
GENERATORS Generator Redux Saga (runner)
GENERATORS Async or any other magical being Redux Saga (runner)
GENERATORS ? Async or any other magical being Redux Saga
(runner)
GENERATORS Which is why it is so easy to test
a redux saga, at every yield @
REDUX SAGA TESTING
REDUX SAGA TESTING
REDUX SAGA TESTING
REDUX SAGA TAKE AWAYS Generator functions are fun Redux Saga
is an amazing solution to the async action problem
REDUX SAGA THANK YOU
REDUX SAGA TAKEAWAY
REDUX SAGA TAKEAWAY
REDUX SAGA TAKEAWAY
REDUX SAGA TAKEAWAY