Skip to content

Instantly share code, notes, and snippets.

@arccoza
Last active October 7, 2024 16:51
Show Gist options
  • Select an option

  • Save arccoza/50fe61c8430fc97a463bf6b8960776ce to your computer and use it in GitHub Desktop.

Select an option

Save arccoza/50fe61c8430fc97a463bf6b8960776ce to your computer and use it in GitHub Desktop.

Revisions

  1. arccoza revised this gist Nov 8, 2019. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,8 @@ class Callable extends Function {
    apply: (target, thisArg, args) => target._call(...args)
    })
    }

    _call(...args) {
    console.log(this, args)
    }
    }
  2. arccoza revised this gist Nov 7, 2019. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,10 @@
    'use strict'

    class Callable extends Function {
    constructor() {
    super()
    return new Proxy(this, {
    apply: (target, thisArg, args) => target._call(...args)
    })
    }
    }
  3. arccoza created this gist Nov 6, 2019.
    2 changes: 2 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    'use strict'