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
240
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
190
Ember ATX: Components
timgthomas
0
120
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
440
Other Decks in Technology
See All in Technology
Biohub - Cell Tracking During Development 5th place solution
rist
0
150
速くなった開発の効果をどう推し量るのか
bulbulpaul
0
110
AIネイティブ組織の作り方。1人のPOとAIから始める、自社での実験
ama_ch
1
440
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
0
200
ゼロから作るWebアプリの新定番!?Amplify Gen 2 × AWS Blocksで実現する「開発速度とRDBの柔軟性のいいとこ取り」
amixedcolor
1
260
生成AI時代のIAMのマニアックな話
takuros
6
3.2k
AWS基盤改善を支える 私たちの理念と行動指針
kentosuzuki
0
220
属人化したISMS運用をGitHubとAIで仕組み化した1年間の記録
sioncojp
4
2.6k
AWS Quick 入門 | 目指せ Quick マスター 01
inariku
PRO
2
340
LLM 基盤と kagent v0 を全部 k8s に入れてみた / Deploy both LLM and kagent v0 in k8s
kota2and3kan
0
210
長い仕事を任せる (Workflows、クラウドセッション、Kiro Web) | 目指せ Kiro マスター 10
inariku
PRO
3
190
プロダクションコードにおける encoding/json から encoding/json/v2 へのスムーズな移行
sansantech
PRO
1
420
Featured
See All Featured
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
610
Designing for humans not robots
tammielis
254
26k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Un-Boring Meetings
codingconduct
0
500
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Believing is Seeing
oripsolob
1
280
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Paper Plane
katiecoart
PRO
6
55k