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
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
97
jQuery Bad Practices
filipebarcos
2
260
Intro to Ruby
filipebarcos
1
130
Other Decks in Programming
See All in Programming
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
160
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
210
AI活用のコスパを最大化する方法
ochtum
0
120
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
520
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
350
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.6k
あなたはユーザーではない #PdENight
kajitack
4
300
Event Storming
hschwentner
3
1.3k
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.4k
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
690
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
570
CSC307 Lecture 13
javiergs
PRO
0
310
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
240
Into the Great Unknown - MozCon
thekraken
40
2.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Building Adaptive Systems
keathley
44
2.9k
BBQ
matthewcrist
89
10k
For a Future-Friendly Web
brad_frost
183
10k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4k
Producing Creativity
orderedlist
PRO
348
40k
Designing for Performance
lara
611
70k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
What's in a price? How to price your products and services
michaelherold
247
13k
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