Created
August 16, 2020 00:33
-
-
Save wtnabe/d4978cf6cdb11308a03896dbc1b06fc7 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
export class FooModel extends Function { | |
private repos: any | |
/** | |
* @param {object} repos | |
* @return {Proxy} | |
*/ | |
constructor (repos: any = createRepository('foo')) { | |
super() | |
this.repos = repos | |
return new Proxy(this.repos, { | |
apply (target, thisArg, argumentsList) { | |
return target[thisArg](argumentsList) | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment