Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
redux-towerでルーティングを制する
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yuki Kodama
February 07, 2017
Technology
2.8k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
redux-towerでルーティングを制する
Yuki Kodama
February 07, 2017
More Decks by Yuki Kodama
See All by Yuki Kodama
エージェント開発におけるObservability
kuy
0
74
マイクロフロントエンドの現状確認
kuy
0
550
Reason
kuy
1
2.5k
Should I use redux-saga or not?
kuy
2
4.8k
redux-sagaで副作用をコントロールする
kuy
4
1.7k
Rails+webpackの落ち穂拾い
kuy
0
1.9k
なぜReduxを使うのか
kuy
25
12k
意地でもReduxを使う
kuy
1
620
Other Decks in Technology
See All in Technology
Maestro MCPとClaude Code Skillsによる自律的なE2Eテスト支援
asmz
0
390
Draft AIエージェントの トークン消費を最小化する 8つの原則
kinopeee
6
1.9k
ひとりで始めた AI駆動開発、チームに広げて何が変わったのか
kenichiodo
1
160
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
0
5.1k
Vue.jsのGitHubから学ぶ意思決定
yut0naga1_fa
1
340
仕様駆動開発の、その先へ。決める力と確かめる仕組み
inariku
1
150
デザインレビューは自動化できるのか?─ Flutter × Figma で UI 品質保証を考える
techiro
2
670
バイブコーディングの特徴と「コケて直す」ループ
happysamurai294
0
130
re:Invent の去年のスケジュールを公開します!
miu_crescent
PRO
0
130
契約で守るコンパウンドプロダクトのデザインシステム
yug1224
1
1.6k
AI駆動開発におけるハーネスエンジニアリングの勘所
tsukuboshi
1
890
Flutter Webを「SDK」として配る — 50以上のゲームを支える埋め込みアーキテクチャ
masayukisuda
0
160
Featured
See All Featured
The Curse of the Amulet
leimatthew05
3
16k
Bash Introduction
62gerente
615
220k
Designing Powerful Visuals for Engaging Learning
tmiket
1
620
Joys of Absence: A Defence of Solitary Play
codingconduct
1
560
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Done Done
chrislema
187
17k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
How STYLIGHT went responsive
nonsquared
100
6.3k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
410
Transcript
redux-tower でルーティングを制する @kuy / Yuki Kodama 2017.02.07 @ Meguro.es #8
自己紹介 @kuy (カイ) / Yuki Kodama 株式会社ジャパンベンチャーリサーチ(新橋 → 恵比寿) entrepedia(アントレペディア)の開発・運用
AWS, Ruby on Rails, JavaScript (React+Redux+Saga) • redux-sagaでルーティングを制する • redux-sagaで非同期処理と戦う • Reduxでコンポーネントを再利用する • ・・・など Qiita の記事
redux-tower というのは・・・ • redux-saga を使ったルーティングライブラリ • ルートがアクティブになってからコンポーネントを表示するまでのロジックを Saga で書く →
フルコントロール可能 ◦ データの読み込み、認証、フォーム内容が変更されていたらページ遷移をブ ロック、途中でリダイレクト、...etc • ルート定義は JSON(JSX は使わない) ◦ ネスト可能、Entering/Leavingフック、省略記法 • SSR は未対応(試してすらいない・・・) ◦ 自分が SSR やってないだけなので PR 歓迎! リポジトリ https://github.com/kuy/redux-tower
ルート定義 #1 ルート定義 ルートアクション (Saga) パス + =
ルート定義 #2 ReduxのStateからログイン状態を取得して、未ログインのときのみログイ ンページにリダイレクト
ルート定義 #3 ログイン処理の結果を待って、成功したときは管理ページ、失敗したときは ログインページにリダイレクト
仕組み #1 • redux-sagaとルートアクションの間に入るProxy Generator ◦ redux-tower 自体も redux-saga で動く
Saga の1つにすぎない • redux-saga ↔ redux-tower ↔ ルートアクション ◦ パスの変更を検出してルート定義とのマッチング ◦ ルートアクションもただのGeneratorなのでnext()呼び出してyieldされ た値を取り出す ◦ 省略記法のときだけSagaのEffectに変換したり、特別な処理 ◦ あとはredux-sagaに丸投げ
仕組み #2 通常のSagaのEffectだった場合(callとかtakeとか)
仕組み #3 React コンポーネントが yield された場合(省略記法)
今後 • セットアップの簡素化 • Leavingフックの改善 • スクロール位置の復元 • バグ直さないと・・・ •
明日、redux-towerを使った社内向けシステムの管理画面リリース • 1.0 リリース ◦ その前にまずは 0.1.0 リリース
ブログアプリのデモ http://kuy.github.io/redux-tower/blog/
yield call(say(“ Thank you !! ”));