Created
February 24, 2020 07:15
-
-
Save takahashi-h5/81ba4d5a26dc8921137aa731ee46cabc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Data { | |
constructor() {} | |
_update() { | |
// 処理 | |
} | |
_insert() { | |
// 処理 | |
} | |
} | |
const index = new Proxy(new Data, { | |
get: (target, name) => { | |
console.log(`${name}メソッド Start`); | |
return target[name]; | |
} | |
}); | |
index._insert() // 各メソッドで最初にログ出力される | |
index._update() // 各メソッドで最初にログ出力される |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment