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
Choo: Fun Functional Framework
Search
Seiya IZUMI
October 21, 2017
Technology
570
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Choo: Fun Functional Framework
第33回 PORTもくもく会
Seiya IZUMI
October 21, 2017
More Decks by Seiya IZUMI
See All by Seiya IZUMI
Node.jsの宣言的マイグレーションツール作った
izumisy
0
79
TailorにおけるSchema-driven UIの実践例
izumisy
0
590
Elm, the functional frontend
izumisy
3
1.2k
Elmの歩き方2019
izumisy
5
3.6k
Our Journey with the Biggest Elm App in Japan
izumisy
0
210
jQueryからElmまで
izumisy
1
1.8k
Ordering and Ordered
izumisy
1
130
StackoverflowでREPを稼ぐ技術
izumisy
1
890
フロントエンド・バリデーション
izumisy
5
3.7k
Other Decks in Technology
See All in Technology
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
350
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
150
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
4
600
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
2
2.1k
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
160
Snowflakeのコスト最適化を支えるアーキテクチャ設計
ktatsuya
1
1.6k
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
190
安心して変更できるWebフロントエンドの作り方
pirosikick
4
2.5k
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
730
Railsのように考える: See through the Master
snoozer05
PRO
3
850
技術的負債から考える、AI時代のエンジニアリング投資 — ビズリーチの技術的負債と向き合った経験から、変更し続けられるソフトウェアを考える/ technical-debt-con2026
visional_engineering_and_design
3
2.9k
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
8
4k
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
Ruling the World: When Life Gets Gamed
codingconduct
0
330
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
The agentic SEO stack - context over prompts
schlessera
0
940
Making the Leap to Tech Lead
cromwellryan
135
10k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
How to Ace a Technical Interview
jacobian
281
24k
Faster Mobile Websites
deanohume
310
32k
Visualization
eitanlees
152
17k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
520
Chasing Engaging Ingredients in Design
codingconduct
0
310
Transcript
Choo Fun Functional Framework Seiya Izumi (@sy_izumi)
About Me • Seiya Izumi • ଂେֶ • JS, Ruby(Rails/Sinatra)
ͱ͖Ͳ͖Golang • trainyardίϯτϦϏϡʔλʔ
Choo.jsͷͳ͠Λ͠·͢
Chooͱ • Fun Functional ProgrammingΛίϯηϓτʹ ͨ͠JSϑϩϯτΤϯυϑϨʔϜϫʔΫ • ඞཁ࠷খݶͷAPIͱϞδϡϥʔɾΞϓϦέʔ γϣϯ •
ϫϯιʔεͰ͙͢ಡΊΔʢ200ߦऑͷindex.jsʣ
ΤίγεςϜ • trainyard/choo-cli … chooͷεΩϟϑΥϧσΟϯάπʔϧ • choojs/bankai … ઃఆϑΝΠϧͳ͠ͰJSόϯυϦϯάLiveReloadͳͲΛͯ͠ ͘ΕΔϏϧυπʔϧ
• choojs/hyperx … ES6ͷλάɾςϯϓϨʔτ͔ΒԾDOMΛੜ͢ΔϞδϡʔ ϧ • choojs/nanobus … ϑΝΠϧαΠζΛͬͨEventEmitterͷସ࣮ • choojs/nanotick … ґଘੑͷͳ͍ process.nextTick ͷ࣮ ͳͲͳͲ
ϑϩϯτΤϯυͱؔܕΞϓϩʔν • ϏϡʔʢVʣεςʔτΛݩʹDOMΛฦ͢୯ ͳΔؔͰ͋Δͱߟ͑Δ • V=f(M) • εςʔτϨεͰςελϒϧ ʢ֎෦ͷґଘੑΛߟྀ͠ͳ͍ʣ
ChooݪଇFluxΞʔΩςΫνϟʹΒͳ͍ • ChooͰΘΕΔͷnanobusͰ࣮͞Εͨγϯ ϓϧͳEventEmitter • Fluxύλʔϯͷૅʹͳ͍ͬͯΔObserverύλʔϯ ͔Β͡ΊΑ͏ͷਫ਼ਆ • ඞཁͳΒࣗͰFluxΞʔΩςΫνϟΛ࣮͢Δ͜ ͱͰ͖Δ
͔ͭͬͯΈΑ͏ʂ
App.js const choo = require('choo') const app = choo() app.use(require('./stores/home'))
app.route('/', require('./pages.home')) if (module.parent) { module.exports = app } else { app.mount('body') } ϛυϧΣΞͱϧʔςΟϯάΛࢦఆͯ͠ɺDOMϚϯτ
View.js const html = require('choo/html') module.exports = function (state, emit)
{ return html` <body> <h1>Hello, World!</h1> <p>If you are seeing this, then the generator works!</p> <h2>Demo</h2> <h3>${state.title}</h3> <input type="text" oninput=${update} value=${state.title} /> </body> ` function update (e) { emit('update', { value: e.target.value }) } } ES6ͷλάϦςϥϧͰDOMߏΛهड़Ͱ͖Δ
Store.js module.exports = function (state, emitter) { state.title = ''
emitter.on('update', function({ value }) { state.title = value emitter.emit('render') }) } storeΠϕϯτϦεφఆٛͱɺstateߏͷఆٛΛߦ͏
͔ΜͨΜ
͔ΜͨΜʂ • ͙͢࡞Εͯ؆୯ʂ • ͨͷ͍͠ʂ • trainyard/choo-cli Λ͏ͱελʔλʔΩοτ Λશ෦४උͯ͘͠ΕΔͷͰΦεεϝ
ൃలฤ: SAMύλʔϯ The SAM Pattern: http://sam.js.org
Happy Coding!