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
220
Icons and the Web: Symbols of the Modern Age
timgthomas
0
160
Constructing Modern UIs with SVG
timgthomas
0
180
Browser Invasion: Desktop Apps and the Web
timgthomas
0
150
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
120
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
140
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
120
Ember ATX: Components
timgthomas
0
82
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
380
Other Decks in Technology
See All in Technology
プロポーザルのコツ ~ Kaigi on Rails 2025 初参加で3名の登壇を実現 ~
naro143
1
160
リーダーになったら未来を語れるようになろう/Speak the Future
sanogemaru
0
350
SoccerNet GSRの紹介と技術応用:選手視点映像を提供するサッカー作戦盤ツール
mixi_engineers
PRO
1
190
Large Vision Language Modelを用いた 文書画像データ化作業自動化の検証、運用 / shibuya_AI
sansan_randd
0
130
英語は話せません!それでも海外チームと信頼関係を作るため、対話を重ねた2ヶ月間のまなび
niioka_97
0
130
オープンソースでどこまでできる?フォーマル検証チャレンジ
msyksphinz
0
120
Simplifying Cloud Native app testing across environments with Dapr and Microcks
salaboy
0
100
Shirankedo NOCで見えてきたeduroam/OpenRoaming運用ノウハウと課題 - BAKUCHIKU BANBAN #2
marokiki
0
170
PLaMoの事後学習を支える技術 / PFN LLMセミナー
pfn
PRO
9
4k
能登半島地震で見えた災害対応の課題と組織変革の重要性
ditccsugii
0
170
そのWAFのブロック、どう活かす? サービスを守るための実践的多層防御と思考法 / WAF blocks defense decision
kaminashi
0
110
LLM時代にデータエンジニアの役割はどう変わるか?
ikkimiyazaki
6
1.1k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
339
57k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
32
2.3k
Fireside Chat
paigeccino
40
3.7k
Code Reviewing Like a Champion
maltzj
525
40k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Unsuck your backbone
ammeep
671
58k
Being A Developer After 40
akosma
91
590k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Designing for Performance
lara
610
69k
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!