Last active
July 26, 2021 04:15
-
-
Save amekusa/28c1cecc543c4799c67f1546c08e325f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * Extensible Function | |
| * @update 2021-07-26 | |
| */ | |
| class Callable extends Function { | |
| constructor() { | |
| super('...args', 'return this.__self.__call(...args)'); | |
| this.__self = this.bind(this); | |
| return this.__self; | |
| } | |
| /** | |
| * Runs when the instance is called as function. | |
| * Override to implement | |
| */ | |
| __call() {} | |
| } | |
| export default Callable; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment