Skip to content

Instantly share code, notes, and snippets.

@tomasperezv
Last active November 13, 2016 12:21
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 tomasperezv/c60980e8aa085c2a712f7154d53a98cc to your computer and use it in GitHub Desktop.
Save tomasperezv/c60980e8aa085c2a712f7154d53a98cc to your computer and use it in GitHub Desktop.
/**
* Registering the acccess to method calls inside of the callback to avoid race
* conditions.
*/
get(obj: Object, key: string): Object {
...
if (typeof originalValue === 'function') {
result = () => {
_registerAccess(key);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment