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
140
Icons and the Web: Symbols of the Modern Age
timgthomas
0
120
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
80
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
110
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
95
Ember ATX: Components
timgthomas
0
77
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
320
Other Decks in Technology
See All in Technology
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
270
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
17
15k
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
230
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
20241220_S3 tablesの使い方を検証してみた
handy
4
610
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
380
生成AIのガバナンスの全体像と現実解
fnifni
1
190
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
100
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.3k
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
140
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
The Invisible Side of Design
smashingmag
298
50k
Making Projects Easy
brettharned
116
5.9k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Why Our Code Smells
bkeepers
PRO
335
57k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Mobile First: as difficult as doing things right
swwweet
222
9k
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!