reactive-di
Advanced tools
Comparing version 0.0.25 to 0.0.26
@@ -78,4 +78,5 @@ 'use strict'; | ||
target: annotation.target, | ||
deps: [annotation.deps] | ||
deps: annotation.deps ? [annotation.deps] : [] | ||
}; | ||
var factoryDep /*: FactoryDep<V>*/ = acc.newRoot().resolveAnnotation(factoryAnnotation); | ||
@@ -82,0 +83,0 @@ if (factoryDep.kind !== 'factory') { |
@@ -170,17 +170,20 @@ 'use strict'; | ||
var observable /*: Observable<V, E>*/ = undefined; | ||
var isPromise = typeof (asyncResult /*: Object*/).then === 'function'; | ||
if (isPromise) { | ||
observable = (0, _promiseToObservable2.default)(((asyncResult /*: any*/) /*: Promise<V>*/)); | ||
this._setMeta((0, _asyncHelpers.setPending)(this.meta)); | ||
this._notify(); | ||
} else if (typeof asyncResult.subscribe === 'function') { | ||
observable = ((asyncResult /*: any*/) /*: Observable<V, E>*/); | ||
} else { | ||
throw new Error(this.base.displayName + ' must return Promise or Observable in AsyncResult'); | ||
} | ||
var isPromise /*: boolean*/ = false; | ||
if (asyncResult) { | ||
isPromise = typeof (asyncResult /*: Object*/).then === 'function'; | ||
if (isPromise) { | ||
observable = (0, _promiseToObservable2.default)(((asyncResult /*: any*/) /*: Promise<V>*/)); | ||
this._setMeta((0, _asyncHelpers.setPending)(this.meta)); | ||
this._notify(); | ||
} else if (typeof asyncResult.subscribe === 'function') { | ||
observable = ((asyncResult /*: any*/) /*: Observable<V, E>*/); | ||
} else { | ||
throw new Error(this.base.displayName + ' must return Promise or Observable in AsyncResult'); | ||
} | ||
this._subscription.unsubscribe(); | ||
this._subscription.unsubscribe(); | ||
this._createPromise(); | ||
this._subscription = observable.subscribe(new RollbackObserver((this /*: Observer<?V, E>*/), this._model, oldValue)); | ||
this._createPromise(); | ||
this._subscription = observable.subscribe(new RollbackObserver((this /*: Observer<?V, E>*/), this._model, oldValue)); | ||
} | ||
if (initial) { | ||
@@ -187,0 +190,0 @@ this._model.set(initial); |
{ | ||
"name": "reactive-di", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"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
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
406422
4832