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
Ember ATX: Ember.Evented
Search
timgthomas
July 24, 2015
Technology
0
100
Ember ATX: Ember.Evented
Lightning talk about one of my favorite Ember mixins, Ember.Evented!
timgthomas
July 24, 2015
Tweet
Share
More Decks by timgthomas
See All by timgthomas
Living Style Guides: Bringing Designers and Developers Together
timgthomas
0
140
Icons and the Web: Symbols of the Modern Age
timgthomas
0
120
Constructing Modern UIs with SVG
timgthomas
0
140
Browser Invasion: Desktop Apps and the Web
timgthomas
0
110
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
80
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
110
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
95
Ember ATX: Components
timgthomas
0
77
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
320
Other Decks in Technology
See All in Technology
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.5k
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
850
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
170
2024年にチャレンジしたことを振り返るぞ
mitchan
0
140
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
18
4.9k
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
32k
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
290
C++26 エラー性動作
faithandbrave
2
800
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
130
UI State設計とテスト方針
rmakiyama
2
670
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Building Adaptive Systems
keathley
38
2.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Rails Girls Zürich Keynote
gr2m
94
13k
Transcript
Hi!
@timgthomas
Scenario
// models/item.js export default Ember.Object.extend({ actions: { save() { this.set('savedAt',
new Date()); } } }); // components/show-item.js export default Ember.Component.extend({ itemSaved: function() { // ... }.observes('item.savedAt') });
”Data Down, Actions Up“
Ember.Evented
// models/item.js export default Ember.Object.extend(Ember.Evented, { actions: { save() {
this.trigger('saved'); } } }); // components/show-item.js export default Ember.Component.extend({ init() { this._super(); this.get('item').on('saved', this.itemSaved); } });
// controllers/list.js export default Ember.Controller.extend(Ember.Evented, { actions: { save() {
this.trigger('saved'); } } }); // controllers/item.js export default Ember.Controller.extend({ init() { this._super(); this.get('controllers.list').on('saved', () => {}); } });
Route Hierarchy Gotcha!
let controller = this.get('controllers.foo'); controller.trigger('foo'); controller.trigger('foo', 'bar'); controller.on('foo', () =>
{}); controller.off('foo', () => {}); controller.one('foo', () => {}); controller.has('foo');
bit.ly/ember-evented
Thanks!