From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/auto-bind/readme.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'node_modules/auto-bind/readme.md') diff --git a/node_modules/auto-bind/readme.md b/node_modules/auto-bind/readme.md index 8c375df9c..a40bcc43a 100644 --- a/node_modules/auto-bind/readme.md +++ b/node_modules/auto-bind/readme.md @@ -6,7 +6,7 @@ ## Install ``` -$ npm install --save auto-bind +$ npm install auto-bind ``` @@ -20,6 +20,7 @@ class Unicorn { this.name = name; autoBind(this); } + message() { return `${this.name} is awesome!`; } @@ -42,7 +43,7 @@ message(); ## API -### autoBind(self) +### autoBind(self, [options]) Bind methods in `self` to their class instance. Returns the `self` object. @@ -52,6 +53,37 @@ Type: `Object` Object with methods to bind. +#### options + +Type: `Object` + +##### include + +Type: `Array` + +Bind only the given methods. + +##### exclude + +Type: `Array` + +Bind methods except for the given methods. + +### autoBind.react(self, [options]) + +Same as `autoBind`, but excludes the default [React component methods](https://reactjs.org/docs/react-component.html). + +```js +class Foo extends React.Component { + constructor(props) { + super(props); + autoBind.react(this); + } + + // … +} +``` + ## Related -- cgit v1.2.3