reactive-di
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -66,4 +66,4 @@ 'use strict'; | ||
function mapToStatus(upd /*: IUpdater*/) /*: Derivable<IUpdaterStatus>*/ { | ||
return upd.status; | ||
function mapToStatus(upd /*: IUpdater*/) /*: IUpdaterStatus*/ { | ||
return upd.status.get(); | ||
} | ||
@@ -310,3 +310,5 @@ | ||
if (meta.initializer) { | ||
this.val(meta.initializer).get(); | ||
var initializer /*: Derivable<() => void>*/ = this.val(meta.initializer); | ||
var fn /*: () => void*/ = initializer.get(); | ||
fn(); | ||
} | ||
@@ -321,4 +323,3 @@ this._path.pop(); | ||
for (var i = 0; i < updaterKeys.length; i++) { | ||
// @todo: remove .get() after https://github.com/ds300/derivablejs/issues/45 | ||
statuses.push(this.val(updaterKeys[i]).get().status); | ||
statuses.push(this.val(updaterKeys[i]).derive(mapToStatus)); | ||
} | ||
@@ -325,0 +326,0 @@ |
@@ -10,5 +10,5 @@ 'use strict'; | ||
render(): any; | ||
componentDidMount: () => void; | ||
componentDidUpdate: (nextProps: Props, nextState: State) => void; | ||
componentWillUnmount: () => void; | ||
componentDidMount(): void; | ||
componentDidUpdate(nextProps: Props, nextState: State): void; | ||
componentWillUnmount(): void; | ||
}*/ | ||
@@ -15,0 +15,0 @@ /*:: export type StyleSheet = { |
{ | ||
"name": "reactive-di", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Reactive dependency injection", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -36,4 +36,4 @@ // @flow | ||
function initA(dep: Dep, updater: Updater): void { | ||
updater.set([ | ||
function initA(dep: Dep, updater: Updater): () => void { | ||
return () => updater.set([ | ||
new ModelA({val: dep.val}) | ||
@@ -72,4 +72,4 @@ ]) | ||
const resolved = new Promise(r => {resolve = r}) | ||
function initA(dep: Dep, updater: Updater): void { | ||
updater.set([ | ||
function initA(dep: Dep, updater: Updater): () => void { | ||
return () => updater.set([ | ||
new ModelA({val: dep.val}), | ||
@@ -76,0 +76,0 @@ () => pmodelA |
@@ -44,4 +44,4 @@ // @flow | ||
function mapToStatus(upd: IUpdater): Derivable<IUpdaterStatus> { | ||
return upd.status | ||
function mapToStatus(upd: IUpdater): IUpdaterStatus { | ||
return upd.status.get() | ||
} | ||
@@ -284,3 +284,5 @@ | ||
if (meta.initializer) { | ||
this.val(meta.initializer).get() | ||
const initializer: Derivable<() => void> = this.val(meta.initializer) | ||
const fn: () => void = initializer.get() | ||
fn() | ||
} | ||
@@ -295,4 +297,3 @@ this._path.pop() | ||
for (let i = 0; i < updaterKeys.length; i++) { | ||
// @todo: remove .get() after https://github.com/ds300/derivablejs/issues/45 | ||
statuses.push(this.val(updaterKeys[i]).get().status) | ||
statuses.push(this.val(updaterKeys[i]).derive(mapToStatus)) | ||
} | ||
@@ -299,0 +300,0 @@ |
@@ -11,5 +11,5 @@ // @flow | ||
render(): any; | ||
componentDidMount: () => void; | ||
componentDidUpdate: (nextProps: Props, nextState: State) => void; | ||
componentWillUnmount: () => void; | ||
componentDidMount(): void; | ||
componentDidUpdate(nextProps: Props, nextState: State): void; | ||
componentWillUnmount(): void; | ||
} | ||
@@ -16,0 +16,0 @@ |
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
179832
3051