reactive-di
Advanced tools
Comparing version 7.0.1 to 7.0.2
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="7.0.2"></a> | ||
## [7.0.2](https://github.com/zerkalica/reactive-di/compare/v7.0.1...v7.0.2) (2018-03-15) | ||
<a name="7.0.1"></a> | ||
@@ -7,0 +12,0 @@ ## [7.0.1](https://github.com/zerkalica/reactive-di/compare/v7.0.0...v7.0.1) (2018-03-15) |
@@ -1,2 +0,2 @@ | ||
import { createConnect, AtomizedComponent } from 'urc'; | ||
import { createConnect, CatchableComponent } from 'urc'; | ||
@@ -290,9 +290,25 @@ function _inheritsLoose(subClass, superClass) { | ||
var names = new Map(); | ||
function normalizeClass(cls) { | ||
var prefix = names.get(cls.displayName); | ||
if (prefix !== undefined) { | ||
prefix++; | ||
names.set(cls.displayName, prefix); | ||
cls.displayName = cls.displayName + prefix; | ||
} else { | ||
names.set(cls.displayName, 0); | ||
} | ||
return cls; | ||
} | ||
var MixinComponent = | ||
/*#__PURE__*/ | ||
function (_AtomizedComponent) { | ||
_inheritsLoose(MixinComponent, _AtomizedComponent); | ||
function (_CatchableComponent) { | ||
_inheritsLoose(MixinComponent, _CatchableComponent); | ||
function MixinComponent() { | ||
return _AtomizedComponent.apply(this, arguments) || this; | ||
return _CatchableComponent.apply(this, arguments) || this; | ||
} | ||
@@ -303,3 +319,3 @@ | ||
_proto.componentWillMount = function componentWillMount() { | ||
_AtomizedComponent.prototype.componentWillMount.call(this); | ||
_CatchableComponent.prototype.componentWillMount.call(this); | ||
@@ -327,3 +343,3 @@ var cns = this.constructor; | ||
_AtomizedComponent.prototype.componentWillUnmount.call(this); | ||
_CatchableComponent.prototype.componentWillUnmount.call(this); | ||
}; | ||
@@ -335,3 +351,3 @@ | ||
var value = _AtomizedComponent.prototype.__value.call(this, isPropsChanged); | ||
var value = _CatchableComponent.prototype.__value.call(this, isPropsChanged); | ||
@@ -347,3 +363,3 @@ Injector.parentContext = oldInjector; | ||
return MixinComponent; | ||
}(AtomizedComponent); | ||
}(CatchableComponent); | ||
@@ -354,3 +370,4 @@ return createConnect({ | ||
BaseComponent: BaseComponent, | ||
MixinComponent: MixinComponent | ||
MixinComponent: MixinComponent, | ||
normalizeClass: normalizeClass | ||
}); | ||
@@ -357,0 +374,0 @@ } |
@@ -294,9 +294,25 @@ 'use strict'; | ||
var names = new Map(); | ||
function normalizeClass(cls) { | ||
var prefix = names.get(cls.displayName); | ||
if (prefix !== undefined) { | ||
prefix++; | ||
names.set(cls.displayName, prefix); | ||
cls.displayName = cls.displayName + prefix; | ||
} else { | ||
names.set(cls.displayName, 0); | ||
} | ||
return cls; | ||
} | ||
var MixinComponent = | ||
/*#__PURE__*/ | ||
function (_AtomizedComponent) { | ||
_inheritsLoose(MixinComponent, _AtomizedComponent); | ||
function (_CatchableComponent) { | ||
_inheritsLoose(MixinComponent, _CatchableComponent); | ||
function MixinComponent() { | ||
return _AtomizedComponent.apply(this, arguments) || this; | ||
return _CatchableComponent.apply(this, arguments) || this; | ||
} | ||
@@ -307,3 +323,3 @@ | ||
_proto.componentWillMount = function componentWillMount() { | ||
_AtomizedComponent.prototype.componentWillMount.call(this); | ||
_CatchableComponent.prototype.componentWillMount.call(this); | ||
@@ -331,3 +347,3 @@ var cns = this.constructor; | ||
_AtomizedComponent.prototype.componentWillUnmount.call(this); | ||
_CatchableComponent.prototype.componentWillUnmount.call(this); | ||
}; | ||
@@ -339,3 +355,3 @@ | ||
var value = _AtomizedComponent.prototype.__value.call(this, isPropsChanged); | ||
var value = _CatchableComponent.prototype.__value.call(this, isPropsChanged); | ||
@@ -351,3 +367,3 @@ Injector.parentContext = oldInjector; | ||
return MixinComponent; | ||
}(urc.AtomizedComponent); | ||
}(urc.CatchableComponent); | ||
@@ -358,3 +374,4 @@ return urc.createConnect({ | ||
BaseComponent: BaseComponent, | ||
MixinComponent: MixinComponent | ||
MixinComponent: MixinComponent, | ||
normalizeClass: normalizeClass | ||
}); | ||
@@ -361,0 +378,0 @@ } |
@@ -294,9 +294,25 @@ (function (global, factory) { | ||
var names = new Map(); | ||
function normalizeClass(cls) { | ||
var prefix = names.get(cls.displayName); | ||
if (prefix !== undefined) { | ||
prefix++; | ||
names.set(cls.displayName, prefix); | ||
cls.displayName = cls.displayName + prefix; | ||
} else { | ||
names.set(cls.displayName, 0); | ||
} | ||
return cls; | ||
} | ||
var MixinComponent = | ||
/*#__PURE__*/ | ||
function (_AtomizedComponent) { | ||
_inheritsLoose(MixinComponent, _AtomizedComponent); | ||
function (_CatchableComponent) { | ||
_inheritsLoose(MixinComponent, _CatchableComponent); | ||
function MixinComponent() { | ||
return _AtomizedComponent.apply(this, arguments) || this; | ||
return _CatchableComponent.apply(this, arguments) || this; | ||
} | ||
@@ -307,3 +323,3 @@ | ||
_proto.componentWillMount = function componentWillMount() { | ||
_AtomizedComponent.prototype.componentWillMount.call(this); | ||
_CatchableComponent.prototype.componentWillMount.call(this); | ||
@@ -331,3 +347,3 @@ var cns = this.constructor; | ||
_AtomizedComponent.prototype.componentWillUnmount.call(this); | ||
_CatchableComponent.prototype.componentWillUnmount.call(this); | ||
}; | ||
@@ -339,3 +355,3 @@ | ||
var value = _AtomizedComponent.prototype.__value.call(this, isPropsChanged); | ||
var value = _CatchableComponent.prototype.__value.call(this, isPropsChanged); | ||
@@ -351,3 +367,3 @@ Injector.parentContext = oldInjector; | ||
return MixinComponent; | ||
}(urc.AtomizedComponent); | ||
}(urc.CatchableComponent); | ||
@@ -358,3 +374,4 @@ return urc.createConnect({ | ||
BaseComponent: BaseComponent, | ||
MixinComponent: MixinComponent | ||
MixinComponent: MixinComponent, | ||
normalizeClass: normalizeClass | ||
}); | ||
@@ -361,0 +378,0 @@ } |
{ | ||
"name": "reactive-di", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "Reactive dependency injection", | ||
@@ -82,4 +82,4 @@ "publishConfig": { | ||
"dependencies": { | ||
"urc": "^1.0.3" | ||
"urc": "^1.0.6" | ||
} | ||
} |
@@ -58,3 +58,4 @@ import babel from 'rollup-plugin-babel' | ||
globals: { | ||
lom_atom: 'lom_atom' | ||
lom_atom: 'lom_atom', | ||
urc: 'urc' | ||
} | ||
@@ -61,0 +62,0 @@ } |
// @flow | ||
import {createConnect, AtomizedComponent} from 'urc' | ||
import {createConnect, CatchableComponent} from 'urc' | ||
import type {IReactHost, IReactAtom, IRenderError, ErrorProps} from 'urc' | ||
@@ -13,3 +13,17 @@ import Injector from './Injector' | ||
) { | ||
class MixinComponent<Props: Object, State, Context> extends AtomizedComponent<Props, State, Context, IElement> { | ||
const names: Map<string, number> = new Map() | ||
function normalizeClass<A: {displayName: string}>(cls: A): A { | ||
let prefix = names.get(cls.displayName) | ||
if (prefix !== undefined) { | ||
prefix++ | ||
names.set(cls.displayName, prefix) | ||
cls.displayName = cls.displayName + prefix | ||
} else { | ||
names.set(cls.displayName, 0) | ||
} | ||
return cls | ||
} | ||
class MixinComponent<Props: Object, State, Context> extends CatchableComponent<Props, State, Context, IElement> { | ||
_injector: Injector | ||
@@ -59,4 +73,5 @@ static instance: number | ||
BaseComponent, | ||
MixinComponent | ||
MixinComponent, | ||
normalizeClass | ||
}): any): IRenderFn<*, *>) | ||
} |
Sorry, the diff of this file is not supported yet
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
182124
2662
Updatedurc@^1.0.6