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
es6 proxy overview
Search
Joe Wang
April 26, 2018
Programming
1
47
es6 proxy overview
Joe Wang
April 26, 2018
Tweet
Share
More Decks by Joe Wang
See All by Joe Wang
fastbuild-前端资源打包平台架构与设计及其他
nodew
0
190
An Introduction to Reactive Programming based on RxJS
nodew
0
43
Lazy List With Generator and Iterator
nodew
1
630
ddd.pdf
nodew
0
190
An Introduction to Haskell
nodew
2
68
Other Decks in Programming
See All in Programming
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
210
subpath importsで始めるモック生活
10tera
0
320
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.8k
Realtime API 入門
riofujimon
0
150
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.2k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
350
Quine, Polyglot, 良いコード
qnighy
4
650
RubyLSPのマルチバイト文字対応
notfounds
0
120
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
150
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
RailsConf 2023
tenderlove
29
900
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Statistics for Hackers
jakevdp
796
220k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
It's Worth the Effort
3n
183
27k
Music & Morning Musume
bryan
46
6.2k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Transcript
ES6 PROXY AN INTRODUCTION TO
OVERVIEW 1、WHAT IS PROXY 2、USE CASES 3、OBSERVABLE & IMMER.JS 4、DISCUSS
WHAT IS PROXY PROXY IS A DESIGN PATTERN
WHAT IS PROXY PROXY IN JAVASCRIPT The Proxy object is
used to define custom behavior for fundamental operations (e.g. property lookup, assignment, enumeration, function invocation, etc)
WHAT IS PROXY PROXY IN JAVASCRIPT handler.apply() handler.construct() handler.defineProperty() handler.deleteProperty()
handler.get() handler.getOwnPropertyDescriptor () handler.getPrototypeOf() handler.has() handler.isExtensible() handler.ownKeys() handler.preventExtensions() handler.set() handler.setPrototypeOf()
USE CASES BASIC USAGE
USE CASES SET DEFAULT PROPERTIES
USE CASES PRIVATE PROPS
USE CASES TRACK PROPS CHANGE
USE CASES SINGLETON
USE CASES PROP VALIDATORS
USE CASES COOKIE OBJECT HANDLER
USE CASES REVOCABLE PROXY
REAL WORLD PROJECT OBSERVABLE-UTIL ▸ https://github.com/nx-js/observer-util
REAL WORLD PROJECT OBSERVABLE-UTIL
REAL WORLD PROJECT IMMER ▸ https://github.com/mweststrate/immer
REAL WORLD PROJECT IMMER
SUMMARY PROS & CONS ▸ Expando property access ▸ Low
coupling ▸ Protect the original object ▸ Meta programming in a way ▸ Browser compatibility