Skip to content

Commit

Permalink
Removed decorators made ie compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
juspears committed Apr 4, 2016
1 parent a28b835 commit 16b8bf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"author": "",
"license": "",
"devDependencies": {
"autoprefixer-loader": "^3.1.0",
"babel-core": "^6.3.26",
"babel-loader": "^6.2.0",
"babel-plugin-react-transform": "^2.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-preset-es2015": "^6.3.13",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"expect": "^1.13.4",
Expand All @@ -35,8 +35,7 @@
"mocha": "^2.3.4",
"react": "^0.14.6",
"react-addons-test-utils": "^0.14.6",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
"webpack": "^1.12.9"
},
"scripts": {
"karma": "NODE_ENV=test karma start --no-single-run --colors --auto-watch",
Expand Down
6 changes: 5 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ function didMount() {

function listener(key, fn) {
function listener$listen(props, context) {

if (!this.injected){
this.injected = {};
}
if (!this._listeners) {
this._listeners = {};
} else if (this._listeners[key]) {
Expand Down Expand Up @@ -94,10 +96,12 @@ function prop(key, fn) {
//this is class scope.
this::extend('componentWillMount', function util$prop$willMount() {
//this is instance scope.
if (!this.injected) this.injected = {};
this.injected[key] = this::fn(this.props[key], key, this.props, this.context);
});

this::extend('componentWillReceiveProps', function util$prop$receiveProps(props, context) {
if (!this.injected) this.injected = {};
if (props[key] !== this.props[key]) {
this.injected[key] = this::fn(props[key], key, props, context);
}
Expand Down

0 comments on commit 16b8bf1

Please sign in to comment.