Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Pitch - Lidando com Efeitos Colaterais com Redu...
Search
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
210
Rust for Rubysts
filipebarcos
2
240
Limpando Seu Código JS Com O Padrão Pub/Sub
filipebarcos
0
190
Tu trabalha em casa?? Que moleza hein!
filipebarcos
0
120
Rediscovering OOP in Rails World
filipebarcos
0
90
jQuery Bad Practices
filipebarcos
2
260
Intro to Ruby
filipebarcos
1
130
Other Decks in Programming
See All in Programming
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
230
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
370
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
470
俺流レスポンシブコーディング 2025
tak_dcxi
13
7.7k
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
24
21k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
5
260
無秩序からの脱却 / Emergence from chaos
nrslib
2
12k
AIコーディングエージェント(Gemini)
kondai24
0
140
AIコーディングエージェント(skywork)
kondai24
0
110
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
300
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
730
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
910
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
4 Signs Your Business is Dying
shpigford
186
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Documentation Writing (for coders)
carmenintech
76
5.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Site-Speed That Sticks
csswizardry
13
990
What's in a price? How to price your products and services
michaelherold
246
12k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Building Applications with DynamoDB
mza
96
6.8k
Six Lessons from altMBA
skipperchong
29
4.1k
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