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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Filipe Costa
February 11, 2017
Programming
0
390
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
200
Tu trabalha em casa?? Que moleza hein!
filipebarcos
0
130
Rediscovering OOP in Rails World
filipebarcos
0
98
jQuery Bad Practices
filipebarcos
2
270
Intro to Ruby
filipebarcos
1
130
Other Decks in Programming
See All in Programming
Ruby and LLM Ecosystem 2nd
koic
1
1.3k
How to stabilize UI tests using XCTest
akkeylab
0
140
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
300
ロボットのための工場に灯りは要らない
watany
12
3.2k
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
150
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
400
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
180
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1k
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
170
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
240
Claude Codeログ基盤の構築
giginet
PRO
7
3.6k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
210
24k
Ruling the World: When Life Gets Gamed
codingconduct
0
180
Docker and Python
trallard
47
3.8k
How to make the Groovebox
asonas
2
2k
Side Projects
sachag
455
43k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
75
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Invisible Side of Design
smashingmag
302
51k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
400
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