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
170
An Introduction to Reactive Programming based on RxJS
nodew
0
37
Lazy List With Generator and Iterator
nodew
1
550
ddd.pdf
nodew
0
180
An Introduction to Haskell
nodew
2
68
Other Decks in Programming
See All in Programming
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
雑に思考を整理する技術と効能
konifar
59
29k
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
530
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
380
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
140
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
Ruby Function Composition
bkuhlmann
1
330
Apache Hive 4 on Treasure Data
ryukobayashi
0
220
Goのエラースタックトレースの歴史と今後
sonatard
7
1.2k
Java 22 Overview
kishida
1
180
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
930
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Product Roadmaps are Hard
iamctodd
44
9.7k
Typedesign – Prime Four
hannesfritz
36
2.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Unsuck your backbone
ammeep
663
57k
Design by the Numbers
sachag
274
18k
Building Applications with DynamoDB
mza
88
5.6k
4 Signs Your Business is Dying
shpigford
175
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
The Invisible Side of Design
smashingmag
294
49k
Making the Leap to Tech Lead
cromwellryan
124
8.5k
A designer walks into a library…
pauljervisheath
200
23k
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