1.0.3 • Published 6 years ago

farnsworth-attach v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

attach()

Syntactical sugar to make it a bit nicer to attach functions to classes

Kind: global function
Example

// example.js
let attach = require('farnsworth-attach')

// document your class...
class Foo {
    // document your method...
    bar() {}

    // document your constructor...
    constructor() {
        attach(this, bar)
    } 
}

function bar() {
   console.log('I was attached') 
}

let foo = new Foo()
foo.bar()
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago