Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Better async redux saga
Search
Kushan Joshi
June 28, 2017
Technology
1
470
Better async redux saga
Slides on Generator Functions and Redux Saga
Kushan Joshi
June 28, 2017
Tweet
Share
Other Decks in Technology
See All in Technology
Google Cloud Next '24 Recap(Cloud Run/k8s)
mokocm
0
370
止まらないLinuxシステムを構築する_高信頼性クラスタ入門
koedoyoshida
3
2.3k
Babylon.js JAPAN活動紹介 (2024/4)
limes2018
1
120
中年男性がメインフレームから クラウドへキャリアシフトしてみた
uechishingo
1
420
Max out Local LLM in Challenging Environments
sashimimochi
2
200
Gradle Build Scanを使ってビルドのことを知ろう potatotips #87
tomorrowkey
2
170
エンジニア候補者向け資料2024.04.24.pdf
macloud
0
3.4k
社内アプリで Cloudflare D1を プロダクト運用してみた体験談(Tokyo)
haochenx
0
130
cgroup v2 で何が変わったのか / TechFeed Experts Night #28
tenforward
2
100
Cloud Service Mesh に触れ合う
phaya72
1
300
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Musicを例に~
otanet
0
320
M5と自作基板をくっつけてみた〜M5 Japan Tour 2024 Spring 福冈 (Fukuoka|福岡)〜
keropiyo
1
240
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
43
12k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
What the flash - Photography Introduction
edds
64
11k
RailsConf 2023
tenderlove
9
570
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
22
1.4k
Product Roadmaps are Hard
iamctodd
45
9.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Documentation Writing (for coders)
carmenintech
60
4k
Designing with Data
zakiwarfel
96
4.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
356
18k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Why Our Code Smells
bkeepers
PRO
331
56k
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