Skip to content

Instantly share code, notes, and snippets.

@takahashi-h5
Created February 24, 2020 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahashi-h5/81ba4d5a26dc8921137aa731ee46cabc to your computer and use it in GitHub Desktop.
Save takahashi-h5/81ba4d5a26dc8921137aa731ee46cabc to your computer and use it in GitHub Desktop.
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