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
94
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
120
Icons and the Web: Symbols of the Modern Age
timgthomas
0
110
Constructing Modern UIs with SVG
timgthomas
0
130
Browser Invasion: Desktop Apps and the Web
timgthomas
0
100
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
72
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
100
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
89
Ember ATX: Components
timgthomas
0
74
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
290
Other Decks in Technology
See All in Technology
さらに高品質・高速化を目指すAI時代のテスト設計支援と、めざす先 / AI Test Lab vol.1
shift_evolve
0
190
OSSコミットしてZennの課題を解決した話
dyoshikawa1993
0
150
サービス開発を前に進めるために 新米リードエンジニアが 取り組んだこと / Steps Taken by a Novice Lead Engineer to Advance Service Development
nologyance
0
180
Amazon FSx for NetApp ONTAPのパフォーマンスチューニング要素をまとめてみた #cm_odyssey #devio2024
non97
0
220
RAGのサービスをリリースして1年3ヶ月が経ちました
segavvy
4
910
開発と事業を繋ぐ!SREのオブザーバビリティ戦略 ~ Developers Summit 2024 Summer ~
leveragestech
0
630
開発生産性をむしろ向上させる セキュリティパートナーの作り方 / Dev Productivity Con 2024
flatt_security
0
360
頼られるのが大好きな 皆さんへ - 支援相手との期待の合わせ方、突き放し方 -/For_people_who_like_to_be_relied_on
naitosatoshi
1
290
dxd2024-生成AIに振り回された3か月間の成功と失敗/dxd2024-link-and-motivation
lmi
2
260
Azure AI ことはじめ
tsubakimoto_s
0
130
ACRiルーム最新情報とAMD GPUサーバーのご紹介
anjn
0
150
コンテナ・K8s研修 - 前半 コンテナ基礎・ハンズオン【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
170
Featured
See All Featured
Building Your Own Lightsaber
phodgson
101
5.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
353
29k
The Illustrated Children's Guide to Kubernetes
chrisshort
39
47k
Building Better People: How to give real-time feedback that sticks.
wjessup
357
18k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
Atom: Resistance is Futile
akmur
261
25k
10 Git Anti Patterns You Should be Aware of
lemiorhan
652
58k
How to Think Like a Performance Engineer
csswizardry
4
590
Docker and Python
trallard
37
2.9k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Art, The Web, and Tiny UX
lynnandtonic
291
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
248
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!