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
190
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
83
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
380
Other Decks in Technology
See All in Technology
“それなりに”安全なWebアプリケーションの作り方
xryuseix
0
280
Sansan BIが実践する AI on BI とセマンティックレイヤー / data_summit_findy
sansan_randd
0
130
フライトコントローラPX4の中身(制御器)を覗いてみた
santana_hammer
1
140
AWS 環境で GitLab Self-managed を試してみた/aws-gitlab-self-managed
emiki
0
350
マイクロリブート ~ACEマインドセットで実現するアジャイル~
sony
0
230
なぜThrottleではなくDebounceだったのか? 700並列リクエストと戦うサーバーサイド実装のすべて
yoshiori
9
3.2k
エンタープライズ企業における開発効率化のためのコンテキスト設計とその活用
sergicalsix
1
320
仕様駆動 x Codex で 超効率開発
ismk
2
1.3k
開発者から見たLLMの進化 202511
ny7760
1
170
CDKの魔法を少し解いてみる ― synth・build・diffで覗くIaCの裏側 ―
takahumi27
1
120
Spring Boot利用を前提としたJavaライブラリ開発方法の提案
kokihoshihara
PRO
2
110
自己的售票系統自己做!
eddie
0
430
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
11
920
Building a Scalable Design System with Sketch
lauravandoore
463
33k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
RailsConf 2023
tenderlove
30
1.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
GitHub's CSS Performance
jonrohan
1032
470k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
660
Practical Orchestrator
shlominoach
190
11k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
A Modern Web Designer's Workflow
chriscoyier
697
190k
BBQ
matthewcrist
89
9.9k
A Tale of Four Properties
chriscoyier
161
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!