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
110
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
170
Icons and the Web: Symbols of the Modern Age
timgthomas
0
150
Constructing Modern UIs with SVG
timgthomas
0
160
Browser Invasion: Desktop Apps and the Web
timgthomas
0
130
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
100
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
130
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
110
Ember ATX: Components
timgthomas
0
80
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
350
Other Decks in Technology
See All in Technology
MCPが変えるAIとの協働
knishioka
1
110
ドキュメント管理の理想と現実
kazuhe
1
280
Perl歴約10年のエンジニアがフルスタックTypeScriptに出会ってみた
papix
1
220
Computer Use〜OpenAIとAnthropicの比較と将来の展望〜
pharma_x_tech
6
730
Dataverseの検索列について
miyakemito
1
150
地味にいろいろあった! 2025春のAmazon Bedrockアップデートおさらい
minorun365
PRO
2
530
Aspire をカスタマイズしよう & Aspire 9.2
nenonaninu
0
320
より良い開発者体験を実現するために~開発初心者が感じた生成AIの可能性~
masakiokuda
0
220
バクラクの認証基盤の成長と現在地 / bakuraku-authn-platform
convto
4
850
Azure Maps Visual in PowerBIで分析しよう
nakasho
0
160
Porting PicoRuby to Another Microcontroller: ESP32
yuuu
4
510
Dynamic Reteaming And Self Organization
miholovesq
3
690
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.4k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Optimising Largest Contentful Paint
csswizardry
37
3.2k
Embracing the Ebb and Flow
colly
85
4.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Documentation Writing (for coders)
carmenintech
69
4.7k
Music & Morning Musume
bryan
47
6.5k
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!