reactive-di
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.syncsetter = exports.createSyncSetter = exports.asyncsetter = exports.createAsyncSetter = exports.observable = exports.createObservable = exports.reset = exports.createReset = exports.loader = exports.createLoader = exports.model = exports.createModel = exports.factory = exports.createFactory = exports.meta = exports.createMeta = exports.createKlass = exports.klass = undefined; | ||
exports.syncsetter = exports.createSyncSetter = exports.asyncsetter = exports.createAsyncSetter = exports.observable = exports.createObservable = exports.reset = exports.createReset = exports.loader = exports.createLoader = exports.model = exports.createModel = exports.factory = exports.createFactory = exports.meta = exports.createMeta = exports.createKlass = exports.klass = exports.alias = undefined; | ||
@@ -27,2 +27,5 @@ var _klass = require('./plugins/class/klass'); | ||
var _alias = require('./plugins/alias/alias'); | ||
exports.alias = _alias.alias; | ||
exports.klass = _klass.klass; | ||
@@ -29,0 +32,0 @@ exports.createKlass = _klass.createKlass; |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
var _set = require('babel-runtime/core-js/set'); | ||
@@ -205,4 +209,4 @@ | ||
key: 'resolve', | ||
value: function resolve(annotatedDep /*: Dependency*/) { | ||
return this.resolveAnnotation(this._getAnnotation(annotatedDep)); | ||
value: function resolve(annotatedDep /*: Dependency|Annotation*/) { | ||
return this.resolveAnnotation((typeof annotatedDep === 'undefined' ? 'undefined' : (0, _typeof3.default)(annotatedDep)) === 'object' ? annotatedDep : this._getAnnotation(annotatedDep)); | ||
} | ||
@@ -209,0 +213,0 @@ }]); |
@@ -65,2 +65,3 @@ 'use strict'; | ||
/*:: import type {Plugin} from 'reactive-di/i/pluginInterfaces'*/ | ||
/*:: import type {AliasAnnotation} from 'reactive-di/i/plugins/aliasInterfaces'*/ | ||
@@ -85,4 +86,11 @@ | ||
for (var i = 0, l = deps.length; i < l; i++) { | ||
var annotation /*: Annotation*/ = deps[i]; | ||
_this.set(annotation.target, (annotation /*: any*/)); | ||
var annotation /*: Annotation|AliasAnnotation*/ = deps[i]; | ||
switch (annotation.kind) { | ||
case 'alias': | ||
_this.set(((annotation /*: any*/) /*: AliasAnnotation*/).source, annotation.target); | ||
break; | ||
default: | ||
_this.set(annotation.target, (annotation /*: any*/)); | ||
break; | ||
} | ||
} | ||
@@ -89,0 +97,0 @@ _this._driver = driver; |
@@ -52,3 +52,3 @@ /* @flow */ | ||
resolveAnnotation<AnyDep: Object>(annotation: Annotation): AnyDep; | ||
resolve<AnyDep: Object>(annotatedDep: Dependency): AnyDep; | ||
resolve<AnyDep: Object>(annotatedDep: Dependency|Annotation): AnyDep; | ||
createId(): DepId; | ||
@@ -55,0 +55,0 @@ addRelation(id: DepId): void; |
{ | ||
"name": "reactive-di", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "Reactive dependency injection", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
402966
137
4766