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
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!座学①
siyuanzh09
0
110
Git scrapingで始める継続的なデータ追跡 / Git Scraping
ohbarye
5
510
あなたの知らないクラフトビールの世界
miura55
0
140
Docker Desktop で Docker を始めよう
zembutsu
PRO
0
200
Evolving Architecture
rainerhahnekamp
3
260
Azureの開発で辛いところ
re3turn
0
240
生成AIのビジネス活用
seosoft
0
110
.NET 最新アップデート ~ AI とクラウド時代のアプリモダナイゼーション
chack411
0
200
生成AI × 旅行 LLMを活用した旅行プラン生成・チャットボット
kominet_ava
0
170
駆け出しリーダーとしての第一歩〜開発チームとの新しい関わり方〜 / Beginning Journey as Team Leader
kaonavi
0
130
PaaSの歴史と、 アプリケーションプラットフォームのこれから
jacopen
7
1.5k
なぜfreeeはハブ・アンド・スポーク型の データメッシュアーキテクチャにチャレンジするのか?
shinichiro_joya
2
590
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
A Tale of Four Properties
chriscoyier
157
23k
Navigating Team Friction
lara
183
15k
The Invisible Side of Design
smashingmag
299
50k
Facilitating Awesome Meetings
lara
51
6.2k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Optimising Largest Contentful Paint
csswizardry
33
3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Adopting Sorbet at Scale
ufuk
74
9.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
How to Ace a Technical Interview
jacobian
276
23k
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!