mobservable
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -0,1 +1,5 @@ | ||
# 1.2.1 | ||
* Computed value now yields consistent results when being inspected while in transaction | ||
# 1.2.0 | ||
@@ -2,0 +6,0 @@ |
export declare function checkIfStateIsBeingModifiedDuringView(context: IContextInfoStruct): void; | ||
export declare function transaction<T>(action: () => T, thisArg?: any): T; | ||
export declare function runAfterTransaction(action: () => void): void; | ||
export declare function isInTransaction(): boolean; | ||
export declare function untracked<T>(action: () => T): T; | ||
@@ -5,0 +6,0 @@ export declare enum NodeState { |
@@ -49,2 +49,6 @@ /** | ||
exports.runAfterTransaction = runAfterTransaction; | ||
function isInTransaction() { | ||
return inTransaction > 0; | ||
} | ||
exports.isInTransaction = isInTransaction; | ||
function untracked(action) { | ||
@@ -51,0 +55,0 @@ try { |
@@ -33,2 +33,5 @@ /** | ||
throw new Error("[mobservable.view '" + this.context.name + "'] Cycle detected"); | ||
if (this.state === dnode_1.NodeState.STALE && dnode_1.isInTransaction()) { | ||
return this.func.call(this.scope); | ||
} | ||
if (this.isSleeping) { | ||
@@ -35,0 +38,0 @@ if (dnode_1.isComputingView()) { |
{ | ||
"name": "mobservable", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Observable data. Reactive functions. Simple code.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
183933
2219