1.2.1 • Published 4 years ago

utilizes.bind v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

bind

Bind all methods of the given object to the object

Usage: bind(this): this

import { bind } from 'utilizes.bind'

class CoolService {

  constructor() {
    bind(this) // binding this via utilizes.bind
  }

  count = 0

  increment() {
    this.count++
  }

}

const coolService = new CoolService()

const increment = coolService.increment

increment() // 'this.count++' point to coolService.count

console.log(coolService.count)
// Output: 1

This module exported from utilizes project.

1.2.1

4 years ago

1.2.0

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.6

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.11

6 years ago

1.0.6

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago