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
390
0
Share
Pitch - Lidando com Efeitos Colaterais com Redux Saga
Pitch para palestrar no CEJS 2017.
Filipe Costa
February 11, 2017
More Decks by Filipe Costa
See All by Filipe Costa
Lidando com Efeitos Colaterais com Redux Saga
filipebarcos
0
230
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
99
jQuery Bad Practices
filipebarcos
2
270
Intro to Ruby
filipebarcos
1
140
Other Decks in Programming
See All in Programming
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
250
AIを導入する前にやるべきこと
negima
2
350
Back to the roots of date
jinroq
0
800
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
160
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
110
継続的な負荷検証を目指して
pyama86
3
1.1k
【ディップ|26年新卒研修資料】TDD実装演習
dip_tech
PRO
0
180
GitHubCopilotCLIをはじめよう.pdf
htkym
0
330
いつか誰かが、と思っていた フロントエンド刷新5年間の実践知
kiichisugihara
1
270
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.6k
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
800
Information Architects: The Missing Link in Design Systems
soysaucechin
0
920
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
We Are The Robots
honzajavorek
0
230
Between Models and Reality
mayunak
3
280
sira's awesome portfolio website redesign presentation
elsirapls
0
230
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
How STYLIGHT went responsive
nonsquared
100
6.1k
The SEO identity crisis: Don't let AI make you average
varn
0
460
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
540
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
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