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
400
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
260
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
100
jQuery Bad Practices
filipebarcos
2
270
Intro to Ruby
filipebarcos
1
140
Other Decks in Programming
See All in Programming
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
170
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
330
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
240
New "Type" system on PicoRuby
pocke
1
920
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
280
Oxlintのカスタムルールの現況
syumai
6
1.1k
Agentic UI
manfredsteyer
PRO
0
160
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
480
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.3k
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
260
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
130
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
730
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
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