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
Direct ProxiesでObject.observeの Polyfillはできるのか
Search
Kazuhito Hokamura
December 18, 2014
Programming
0
600
Direct ProxiesでObject.observeの Polyfillはできるのか
Kazuhito Hokamura
December 18, 2014
Tweet
Share
More Decks by Kazuhito Hokamura
See All by Kazuhito Hokamura
TypeScriptとGraphQLで実現する 型安全なAPI実装 / TSKaigi 2024
hokaccha
5
3.8k
Kotlin製のGraphQLサーバーをNode.jsでモジュラモノリス化している話
hokaccha
0
3.2k
GraphQLの負債と向き合うためにやっていること
hokaccha
2
1.3k
ユビーのアーキテクチャに対する取り組み
hokaccha
1
350
RailsエンジニアのためのNext.js入門
hokaccha
7
19k
Cookpad Summer Internship 2021 Web Frontend
hokaccha
0
7k
巨大なモノリシック Rails アプリケーションの マイクロサービス化戦略 / 2019 microservices in cookpad
hokaccha
3
3.7k
巨大なRailsアプリケーションを「普通」にするための取り組み
hokaccha
1
890
Web Frontend Improvement in Cookpad
hokaccha
1
990
Other Decks in Programming
See All in Programming
現場から考えるソフトウェアエンジニアリングの価値と実験
nomuson
1
140
Google Play Consoleデベロッパー アカウントの確認 / Verifying your Play Console developer account
kubode
0
310
CSC509 Lecture 05
javiergs
PRO
0
180
Why I Choose NetBeans for Jakarta EE
ivargrimstad
0
850
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1.2k
フロントエンドの現在地とこれから
koba04
10
4.7k
Successful with Signals: 3 Rules for Your Architecture
manfredsteyer
PRO
0
140
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
1
140
tsconfig.jsonの最近の新機能 ファイルパス編
uhyo
7
1.9k
Vertical Architectures for Scalable Angular Applications
manfredsteyer
PRO
0
210
Kubernetes上でOracle_Databaseの運用を楽にするOraOperatorの紹介
nnaka2992
0
170
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
930
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
49
4.8k
A Modern Web Designer's Workflow
chriscoyier
692
190k
How to Ace a Technical Interview
jacobian
275
23k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
260
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
Navigating Team Friction
lara
183
14k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
What's new in Ruby 2.0
geeforr
342
31k
Transcript
Direct ProxiesͰObject.observeͷ PolyfillͰ͖Δͷ͔
None
Object.observe Object.observe(obj, (changes) => { // do something }); •
objΛมߋ͢Δͱhandler͕ؔݺΕΔ
Direct Proxies var proxy = new Proxy(obj, { set(target, name,
val, receiver) { // do something } }); • objΛҾͱͯ͠৽ͨͳཧΦϒδΣΫτʢproxyʣΛಘΔ • proxyΛૢ࡞ͨ࣌͠ʹhandler͕ݺΕΔ • objΛૢ࡞ͯ͠handlerݺΕͳ͍
͜ͷAPIΛPolyfill͢Δ ͷແཧͰɾɾʁ Object.observe(obj, (changes) => { // do something });
ProxyͷPolyfillϥΠϒϥϦ
None
harmony-reflect/examples/observer.js
͍͚ͦ͏ʂʂ
ͳΜ͔ΤϥΔɾɾ // Firefox 36.0 Observer(Object); // enable polyfill var obj
= {}; Object.observe(obj, handler); //=> uncaught exception: can only get notifier of observable objects, given [object Object]
͜͏͢Δඞཁ͕͋ΔΒ͍͠ var obj = {}; var o = Object.createObservable(obj); Object.observe(o,
handler);
Q: Direct ProxiesͰObject.observeͷ PolyfillͰ͖Δͷ͔
A:ʢͨͿΜʣແཧ
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ