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
150
Icons and the Web: Symbols of the Modern Age
timgthomas
0
130
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
86
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
110
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
100
Ember ATX: Components
timgthomas
0
77
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
330
Other Decks in Technology
See All in Technology
メールヘッダーを見てみよう
hinono
0
110
0→1事業こそPMは営業すべし / pmconf #落選お披露目 / PM should do sales in zero to one
roki_n_
PRO
1
1.5k
月間60万ユーザーを抱える 個人開発サービス「Walica」の 技術スタック変遷
miyachin
1
140
Goで実践するBFP
hiroyaterui
1
120
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
メンバーがオーナーシップを発揮しやすいチームづくり
ham0215
2
140
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
190
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
AWSの生成AIサービス Amazon Bedrock入門!(2025年1月版)
minorun365
PRO
7
470
2025年に挑戦したいこと
molmolken
0
160
タイミーのデータ活用を支えるdbt Cloud導入とこれから
ttccddtoki
1
170
dbtを中心にして組織のアジリティとガバナンスのトレードオンを考えてみた
gappy50
0
290
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
Building Adaptive Systems
keathley
38
2.4k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Music & Morning Musume
bryan
46
6.3k
Thoughts on Productivity
jonyablonski
68
4.4k
Producing Creativity
orderedlist
PRO
343
39k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
3
180
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Facilitating Awesome Meetings
lara
51
6.2k
RailsConf 2023
tenderlove
29
970
Raft: Consensus for Rubyists
vanstee
137
6.7k
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!