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
80
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
91
Icons and the Web: Symbols of the Modern Age
timgthomas
0
96
Constructing Modern UIs with SVG
timgthomas
0
120
Browser Invasion: Desktop Apps and the Web
timgthomas
0
97
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
69
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
96
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
80
Ember ATX: Components
timgthomas
0
73
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
270
Other Decks in Technology
See All in Technology
Algyan イベント振り返り
linyixian
0
190
"好き"との生活/Regularly update profile with GitHub Actions
judeeeee
0
150
SREとその組織類型
tatsuo48
8
1.5k
長期間TiDBを使ってきた話 @ 私たちはなぜNewSQLを使うのかTiDB選定5社が語る選定理由と活用LT / Experiences with TiDB Over Time
chibiegg
2
700
Apple Vision Pro trial session
akkeylab
0
120
Databricks:『生成AI World Cup』のご案内
databricksjapan
2
150
SIEMを用いて、セキュリティログ分析の可視化と分析を実現し、PDCAサイクルを回してみた
coconala_engineer
0
220
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs (QCon London)
inesmontani
PRO
1
150
WebアプリケーションにおけるPDOの使い方入門 / phpcon odawara 2024
meihei3
2
430
開発生産性向上サービスを作るFindyが自分たちで開発生産性を爆上げした組織づくりの歩み / Findy's path to boosting its own development productivity 2024-04-17
ma3tk
3
330
普段有償でサポート業務をしているCSAが技術知見を無料で公開する理由
07jp27
1
630
SPI原点回帰論:事業課題とFour Keysの結節点を見出す実践的ソフトウェアプロセス改善 / DevOpsDays Tokyo 2024
visional_engineering_and_design
4
1.5k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
14
3.8k
Building Effective Engineering Teams - LeadDev
addyosmani
27
1.8k
Web development in the modern age
philhawksworth
202
10k
How GitHub (no longer) Works
holman
304
140k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.4k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Making the Leap to Tech Lead
cromwellryan
123
8.5k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Infographics Made Easy
chrislema
237
18k
Building an army of robots
kneath
300
41k
The Cult of Friendly URLs
andyhume
74
5.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
258
12k
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!