es6-react-mixins
Advanced tools
Comparing version 0.1.3 to 0.1.4
'use strict'; | ||
var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
var _inherits = require('babel-runtime/helpers/inherits')['default']; | ||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
var _Object$assign = require('babel-runtime/core-js/object/assign')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
_Object$defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
/* | ||
@@ -17,7 +22,9 @@ * based on https://gist.github.com/sebmarkbage/fac0830dbb13ccbff596 | ||
var _React = require('react'); | ||
var _react = require('react'); | ||
var _React2 = _interopRequireDefault(_React); | ||
var _react2 = _interopRequireDefault(_react); | ||
var noop = function noop() {}; | ||
var noop = function noop() { | ||
return null; | ||
}; | ||
var es6ify = function es6ify(mixin) { | ||
@@ -46,3 +53,3 @@ if (typeof mixin === 'function') { | ||
Object.assign(NewClass.prototype, mixin); | ||
_Object$assign(NewClass.prototype, mixin); | ||
return NewClass; | ||
@@ -69,3 +76,3 @@ }; | ||
return Base; | ||
})(_React2['default'].Component); | ||
})(_react2['default'].Component); | ||
@@ -72,0 +79,0 @@ // No-ops so we need not check before calling super() |
{ | ||
"name": "es6-react-mixins", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Augments ES6 classes with ES6 or traditional React mixins", | ||
@@ -8,3 +8,3 @@ "author": "Angus Croll", | ||
"scripts": { | ||
"compile": "babel src --out-dir lib", | ||
"compile": "babel --optional runtime src --out-dir lib", | ||
"prepublish": "npm run compile", | ||
@@ -11,0 +11,0 @@ "test": "./node_modules/karma/bin/karma start --single-run" |
# es6-react-mixins | ||
[![Build Status](https://secure.travis-ci.org/angus-c/es6-react-mixins.png?branch=master)](http://travis-ci.org/angus-c/es6-react-mixins) | ||
[![Build Status](https://secure.travis-ci.org/angus-c/es6-react-mixins.png?branch=master)](http://travis-ci.org/angus-c/es6-react-mixins) [![npm version](http://img.shields.io/npm/v/es6-react-mixins.svg)](https://npmjs.org/package/es6-react-mixins) [![Dependency Status](https://david-dm.org/angus-c/es6-react-mixins.svg)](https://david-dm.org/angus-c/es6-react-mixins.svg) | ||
@@ -22,7 +22,7 @@ `es6-react-mixins` is a module that lets you augment your ES6 React component classes with any number of custom ES6 mixins. You can also use it to merge traditional pre-ES6 React mixin objects into your ES6 React classes. | ||
React components invokes mixins with a call to `super`. | ||
React components invoke mixins with a call to `super`. | ||
```js | ||
import 'mixin' from 'es6-react-mixins'; | ||
import 'React' from 'react'; | ||
import mixin from 'es6-react-mixins'; | ||
import React from 'react'; | ||
@@ -41,3 +41,3 @@ class MyComponent extends mixin(es6Mixin) { | ||
``` | ||
The API works with any number of mixins. Obviously order matters withe multiple mixins–each super call works its way up the hierarchy. | ||
The API works with any number of mixins. Obviously order matters with multiple mixins – each `super` call works its way up the mixin hierarchy. | ||
@@ -109,3 +109,3 @@ ```js | ||
The source is written in es6 put there's an npm prebublish step which transpiles to es5 and dumps into `lib` directory - which is the default import. | ||
The source is written in es6 but there's an npm prebublish step which transpiles to es5 and dumps into `lib` directory - which is the default import. | ||
@@ -112,0 +112,0 @@ #Testing |
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
7942
65