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 in Production
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Sam Yamashita
July 11, 2016
Technology
320
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Redux in Production
Sam Yamashita
July 11, 2016
More Decks by Sam Yamashita
See All by Sam Yamashita
AI が自動テストの分野でどのように使われるのか
unbabel
0
160
Thailand
unbabel
1
91
DX に優れた多言語化ドキュメント作成方法
unbabel
0
540
3 Tips for meeting
unbabel
0
290
What is GitHub Marketplace and good for?
unbabel
0
120
OSS 翻訳と GitLocalize
unbabel
0
560
Introduction to RAIL
unbabel
0
120
CSS Architecture
unbabel
1
79
Git・Githubに関する隠された便利な機能
unbabel
1
430
Other Decks in Technology
See All in Technology
AI時代、データエンジニアが一番おもろい
genshun9
0
660
What the customer really needed
kawaguti
PRO
3
210
「守り」で活用するオンデバイスLLM 〜写ってはいけないを総力戦で防ぐ〜 / iOSDC Japan 2026
nakamuuu
0
170
beyond jj: config & tools ecosystem
indirect
0
3k
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
5
1.8k
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
2
550
今話題のAI「Jev」って何? 宇宙最速で学ぶ会
minorun365
PRO
27
16k
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
160
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
340
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
350
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
2
490
生成AIエージェントを用いた、 手動テスト手順書から自動テストへの 変換手法の検討
magicpod
0
160
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
600
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
670
Side Projects
sachag
456
43k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
We Have a Design System, Now What?
morganepeng
55
8.3k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Transcript
JS Night Redux in Production #dcubeio
github.com/sotayamashita twitter.com/sota0805 blog.sotayamashita.com 山下颯太 ソフトウェアエンジニア 株式会社サイバーエージェント 株式会社シロク
今日話すこと • Redux ͱʁ • Flux ͱʁ はじめに Growth Push
• Growth Pushͱʁ • എܠ • վमલͷߏ • վमޙͷߏ • Switch ͩΒ͚ͷ Reducer • ࠶ར༻Մೳͳ Component
Flux とは?
Action Dispatcher Store View Flux ͱʁ ਤ A cartoon intro
to Flux by Lin Clark
Reduxとは?
–Dan Abramov “I didn't actually intend Redux to become a
popular Flux library—I wrote it as I was working on my ReactEurope talk on hot reloading with time travel.” Reduxͱʁ Why use Redux over Facebook Flux?
Reduxͱʁ Store 内の state とそのロジックを分離 todos: [“eat”, “sleep”] todos: [“”,
“”] addTodo: (todo) => {} addTodo: (todo) => {} todos: [“eat”, “sleep”] addTodo: (todo) => {} todos: [“eat”, “sleep”] addTodo: (todo) => {} ߋ৽ 更新 更新 Before After ਤ A cartoon intro to Redux by Lin Clark
Reduxͱʁ State を action から直接上書きしない Before Action 1 Action2 Action
3 state ਤ A cartoon intro to Redux by Lin Clark
Reduxͱʁ State を action から直接上書きしない After Action 1 Action2 Action
3 state 1 state 2 state 3 ਤ A cartoon intro to Redux by Lin Clark
Reduxͱʁ 階層になっている state からなる 1つの大きな state Before dispatcher store store
store log ਤ A cartoon intro to Redux by Lin Clark
Reduxͱʁ ਤ A cartoon intro to Redux by Lin Clark
階層になっている state からなる 1つの大きな state After dispatcher reducer reducer reducer log reducer reducer reducer reducer reducer
Growth Push とは?
Growth Push ͱʁ http://growthpush.com/
վमલͷߏ • クライアントサイド MVC ライブラリ • テンプレートエンジン • Alt JavaScript
• フレームワーク
վमલͷߏ • クライアントサイド MVC ライブラリ • テンプレートエンジン • Alt JavaScript
• フレームワーク この部分を変更
վमޙͷߏ • フレームワーク • フロント SPA
Switch だらけの Reducer
tree . └── reducers ├── index.js ├── application.js ├── notification.js
├── client.js ├── event.js └── tag.js Switch ͩΒ͚ͷ Reducer
http://redux.js.org/docs/basics/Reducers.html Switch ͩΒ͚ͷ Reducer 1 import * as ActionTypes from
' ../actions/todoApp'; 2 3 function todoApp(state = initialState, action) { 4 switch (action.type) { 5 case ActionTypes.SET_VISIBILITY_FILTER: 6 return { 7 ...state, 8 visibilityFilter: action.filter 9 }; 10 default: 11 return state 12 } 13 }
https://github.com/acdlite/redux-actions Switch ͩΒ͚ͷ Reducer 1 const todoApp = handleActions({ 2
SET_VISIBILITY_FILTER: (state, action) => ({ 3 visibilityFilter: action.filter 4 }), 5 }), initialState );
Before After Switch ͩΒ͚ͷ Reducer 1 import * as ActionTypes
from ' ../actions/todoApp'; 2 3 function todoApp(state = initialState, action) { 4 switch (action.type) { 5 case ActionTypes.SET_VISIBILITY_FILTER: 6 return { 7 ...state, 8 visibilityFilter: action.filter 9 }; 10 default: 11 return state 12 } 13 } 1 const todoApp = handleActions({ 2 SET_VISIBILITY_FILTER: (state, action) => ({ 3 visibilityFilter: action.filter 4 }), 5 }), initialState );
再利用可能なコンポーネント
࠶ར༻Մೳͳίϯϙʔωϯτ • Container Components • Presentational Components
࠶ར༻Մೳͳίϯϙʔωϯτ Container Presentational Container と Presentational の関係性 State Presentational Presentational
Presentational
࠶ར༻Մೳͳίϯϙʔωϯτ Container Presentational Container と Presentational の関係性 Store Presentational Presentational
Presentational
࠶ར༻Մೳͳίϯϙʔωϯτ Container Presentational Container と Presentational の関係性 Store Presentational Presentational
Presentational ࠶ར༻͢Δͱ͜
࠶ར༻Մೳͳίϯϙʔωϯτ Container Presentational Container と Presentational の関係性 State Presentational Presentational
Presentational
࠶ར༻Մೳͳίϯϙʔωϯτ Container Components Presentational and Container Components • Redux であれば
connect() を使用してStore をもらうところ • スタイルをもたない傾向にある • 余計な DOM を含まない傾向にある • 例えば、 ユーザーページ、ログインページ
࠶ར༻Մೳͳίϯϙʔωϯτ Container Presentational Container と Presentational の関係性 Store Presentational Presentational
Presentational
࠶ར༻Մೳͳίϯϙʔωϯτ Presentational Components Presentational and Container Components • functional component
で実装できる傾向がある • スタイルをもちます • 実際の DOM を含みます • 例えば、 リスト、モーダル
࠶ར༻Մೳͳίϯϙʔωϯτ Presentational and Container Components 1 const TodoList = ({
todos }) => ( 2 <ul> 3 {todos.map(todo => 4 <Todo 5 key={todo.id} 6 { ...todo} 7 /> 8 )} 9 </ul> 10 ); 1 class todoPage extends React.Component { 2 render() { 3 return ( 4 <div> 5 <TodoList todos={this.props.todos} /> 6 </div> 7 ) 8 } 9 }
࠶ར༻Մೳͳίϯϙʔωϯτ Container Presentational Store Presentational Presentational Presentational
バケツリレー???
࠶ར༻Մೳͳίϯϙʔωϯτ Container Store Container Container Container Container
࠶ར༻Մೳͳίϯϙʔωϯτ 再利用可能とは?
࠶ར༻Մೳͳίϯϙʔωϯτ https://github.com/sotayamashita/curator
最後に
࠷ޙʹ • ドキュメントが充実してる • 日本語だったら @kuy さんの Qiita にある記事とか •
サンプルプロジェクトがたくさん • コミュニティが充実してる • サンプルプロジェクト作ってみた(全然間に合わなかった) • https://github.com/sotayamashita/curator
ご清聴ありがとうございました