Skip to content

Commit

Permalink
fix(react): Fix problem with WRONG react dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Thram committed Jan 23, 2017
1 parent bfa17e3 commit 81ae6f2
Show file tree
Hide file tree
Showing 8 changed files with 6,133 additions and 5 deletions.
Binary file added .DS_Store
Binary file not shown.
40 changes: 40 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.connect = undefined;

var _thrux = require("thrux");

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(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) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
* Created by thram on 21/01/17.
*/


var connect = exports.connect = function connect(stateKey, ReactComponent) {
var ThruxComponent = function (_ReactComponent) {
_inherits(ThruxComponent, _ReactComponent);

function ThruxComponent(props) {
_classCallCheck(this, ThruxComponent);

var _this = _possibleConstructorReturn(this, (ThruxComponent.__proto__ || Object.getPrototypeOf(ThruxComponent)).call(this, props));

(0, _thrux.observe)(stateKey, function (state) {
var newState = {};
newState[stateKey] = state;
_this.setState(newState);
});
return _this;
}

return ThruxComponent;
}(ReactComponent);

return ThruxComponent;
};
Loading

0 comments on commit 81ae6f2

Please sign in to comment.