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
Pitch - Lidando com Efeitos Colaterais com Redu...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Filipe Costa
February 11, 2017
Programming
0
380
Pitch - Lidando com Efeitos Colaterais com Redux Saga
Pitch para palestrar no CEJS 2017.
Filipe Costa
February 11, 2017
Tweet
Share
More Decks by Filipe Costa
See All by Filipe Costa
Lidando com Efeitos Colaterais com Redux Saga
filipebarcos
0
220
Rust for Rubysts
filipebarcos
2
250
Limpando Seu Código JS Com O Padrão Pub/Sub
filipebarcos
0
190
Tu trabalha em casa?? Que moleza hein!
filipebarcos
0
130
Rediscovering OOP in Rails World
filipebarcos
0
95
jQuery Bad Practices
filipebarcos
2
260
Intro to Ruby
filipebarcos
1
130
Other Decks in Programming
See All in Programming
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
610
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
220
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
CSC307 Lecture 01
javiergs
PRO
0
690
高速開発のためのコード整理術
sutetotanuki
1
410
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
730
MUSUBIXとは
nahisaho
0
140
AtCoder Conference 2025
shindannin
0
1.1k
Featured
See All Featured
Paper Plane
katiecoart
PRO
0
46k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
54
Crafting Experiences
bethany
1
50
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Are puppies a ranking factor?
jonoalderson
1
2.7k
GitHub's CSS Performance
jonrohan
1032
470k
Claude Code のすすめ
schroneko
67
210k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
150
So, you think you're a good person
axbom
PRO
2
1.9k
Producing Creativity
orderedlist
PRO
348
40k
Transcript
Lidando com Efeitos Colaterais com Redux Saga @filipebarcos
Redux
"Evolui ideias do Flux, mas evita suas complexidades pegando dicas
do Elm" — github.com/reactjs/redux Redux
Redux UI Reducer Store Action dispatched (currentState, action) => newState
New State
Redux UI Middleware Reducer Store Action dispatched (currentState, action) =>
newState New State Action forwarded Action dispatched
Redux Saga
github.com/redux-saga/redux-saga
JavaScript Generator Functions*
ES6
Podemos paralisar a execução da função
function* foo(x) { const y = 2 * (yield (x
+ 1)); const z = yield (y / 3); return (x + y + z); } var it = foo(5); // note: not sending anything into `next()` here console.log(it.next()); // { value:6, done:false } console.log(it.next(12)); // { value:8, done:false } console.log(it.next(13)); // { value:42, done:true } https://davidwalsh.name/es6-generators
import { call, put } from 'redux-saga/effects'; export function* fetchData(action)
{ try { const data = yield call(Api.fetchUser, action.payload.url); yield put({type: "FETCH_SUCCEEDED", data}); } catch (error) { yield put({type: "FETCH_FAILED", error}); } } function* watchFetchData() { yield takeEvery('FETCH_REQUESTED', fetchData); } https://redux-saga.github.io/redux-saga/docs/basics/UsingSagaHelpers.html
import { takeEvery } from 'redux-saga'; // FETCH_USERS function* fetchUsers(action)
{ ... } // CREATE_USER function* createUser(action) { ... } // use them in parallel export default function* rootSaga() { yield takeEvery('FETCH_USERS', fetchUsers); yield takeEvery('CREATE_USER', createUser); } https://redux-saga.github.io/redux-saga/docs/basics/UsingSagaHelpers.html
github.com/filipebarcos/redux-saga-example
gist.github.com/filipebarcos/ 0a137d6ca837c117f999958a365fc5b6
Obrigado. @filipebarcos