Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ember ATX: Ember.Evented
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
timgthomas
July 24, 2015
Technology
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ember ATX: Ember.Evented
Lightning talk about one of my favorite Ember mixins, Ember.Evented!
timgthomas
July 24, 2015
Transcript
12 slides
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!
More Decks by timgthomas
See All by timgthomas
Living Style Guides: Bringing Designers and Developers Together
timgthomas
0
280
Icons and the Web: Symbols of the Modern Age
timgthomas
0
250
Constructing Modern UIs with SVG
timgthomas
0
250
Browser Invasion: Desktop Apps and the Web
timgthomas
0
220
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
170
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
210
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
200
Ember ATX: Components
timgthomas
0
130
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
440
Other Decks in Technology
See All in Technology
[NW-JAWS DAY]「うちのAWS、インターネット出られないんで」― AWS外の自社サービスをPrivateLinkでシュッと公開する方法
ykimi
3
920
Welcome JXL!
dynamis
0
120
人の努力に頼らないセキュリティをエンジニアリングする在り方 / An approach to engineering security that does not rely on human effort
carta_engineering
0
240
社内アプリ基盤「Quartz」による、 非エンジニアとAIに本番デプロイを 任せても壊れないプラットフォームの設計
staka121
PRO
1
230
Go でトランザクション、どう書いてますか?
knwoop
1
600
[DBRE Summit 26] DBRE はデータベース運用をどう変えたのか
_awache
0
130
リリースしたで終わらない。 観測できるフロントエンド開発
yamakenji24
2
240
From vibe coding to reliable (agentic) development
jcabot
0
240
コーディングできない僕にBobが舞い降りた
shumpei3
0
200
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
200
専門家に使ってもらうAIプロダクトをつくる - 病院の医事課向けDPCコーディング支援システムの設計と評価
hagino3000
4
1k
「個社」ではなく「業界」の課題を解く AI 対話開発 ー 価値を広げる設計と、価値を守るエンジニアリング ー
ivry_presentationmaterials
4
870
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
310
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.5k
Believing is Seeing
oripsolob
1
290
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
350
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
61k
Discover your Explorer Soul
emna__ayadi
2
1.3k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.7k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
570
The Cost Of JavaScript in 2023
addyosmani
56
10k
Building Applications with DynamoDB
mza
96
7.3k