react-class
Advanced tools
Comparing version 3.2.0 to 3.2.2
@@ -44,2 +44,46 @@ 'use strict'; | ||
t.true(bound() === obj, 'bound'); | ||
}); | ||
(0, _ava2.default)('autoBind filter works', function (t) { | ||
var MyClass = function () { | ||
function MyClass() { | ||
_classCallCheck(this, MyClass); | ||
this.name = 'myclass'; | ||
} | ||
_createClass(MyClass, [{ | ||
key: 'returnThis', | ||
value: function returnThis() { | ||
return this || 0; | ||
} | ||
}, { | ||
key: 'notBound', | ||
value: function notBound() { | ||
return this || 1; | ||
} | ||
}, { | ||
key: 'setState', | ||
value: function setState() {} | ||
}]); | ||
return MyClass; | ||
}(); | ||
var obj = new MyClass(); | ||
var unbound = (0, _autoBind2.default)(obj, { notBound: true }).notBound; | ||
t.is(unbound(), 1, 'unbound'); | ||
var boundObj = (0, _autoBind2.default)(obj, function (name) { | ||
return name !== 'notBound'; | ||
}); | ||
var returnThisBound = boundObj.returnThis; | ||
var notBound = boundObj.notBound; | ||
t.is(returnThisBound(), boundObj, 'returnThisBound'); | ||
t.is(notBound(), 1, 'notBound'); | ||
}); |
@@ -33,4 +33,2 @@ "use strict"; | ||
exports.autoBind = autoBind; | ||
exports.Component = ReactClass; | ||
module.exports = ReactClass; | ||
exports.Component = ReactClass; |
{ | ||
"name": "react-class", | ||
"version": "3.2.0", | ||
"version": "3.2.2", | ||
"description": "A carefully crafted base class for all your React components ", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -43,3 +43,3 @@ # react-class | ||
```jsx | ||
import 'react-class/autoBind' | ||
import autoBind from 'react-class/autoBind' | ||
@@ -46,0 +46,0 @@ // or |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20236
445