-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): Fix problem with WRONG react dependency
- Loading branch information
Showing
8 changed files
with
6,133 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
Oops, something went wrong.