@dhmk/atom
Advanced tools
Comparing version 2.0.1-test.13 to 2.0.1-test.14
@@ -12,2 +12,4 @@ export declare class DerivedAtom { | ||
deps: any; | ||
prevDeps: any; | ||
pdi: any; | ||
isObserved: any; | ||
@@ -14,0 +16,0 @@ isEffect: any; |
@@ -63,4 +63,5 @@ var __assign = (this && this.__assign) || function () { | ||
if (this.state === AtomState.Stale) { | ||
var mark_1 = (this.mark = new Id()); | ||
var prevDeps = this.deps; | ||
var mark = (this.mark = new Id()); | ||
this.prevDeps = this.deps; | ||
this.pdi = 0; | ||
this.deps = []; | ||
@@ -91,8 +92,8 @@ if (!this.isObserved && runtime.currentAtom) { | ||
runtime.currentAtom = prev; | ||
prevDeps.forEach(function (t) { | ||
var a = t.a; | ||
if (a.m !== mark_1) | ||
removeAtom(a, _this); | ||
for (var i = this.pdi, d = this.prevDeps, s = d.length; i < s; i++) { | ||
var a = d[i].a; | ||
if (a.m !== mark) | ||
removeAtom(a, this); | ||
a.readFlag = false; | ||
}); | ||
} | ||
this.deps.forEach(function (t) { | ||
@@ -126,2 +127,7 @@ var a = t.a; | ||
} | ||
var pd = this.prevDeps; | ||
var pdi = this.pdi; | ||
if (pdi < pd.length && pd[pdi].a === a) { | ||
this.pdi++; | ||
} | ||
var tr = { a: a, v: v, t: t }; // literal is faster than class | ||
@@ -128,0 +134,0 @@ a.m = mark; |
@@ -12,2 +12,4 @@ export declare class DerivedAtom { | ||
deps: any; | ||
prevDeps: any; | ||
pdi: any; | ||
isObserved: any; | ||
@@ -14,0 +16,0 @@ isEffect: any; |
@@ -66,4 +66,5 @@ "use strict"; | ||
if (this.state === types_1.AtomState.Stale) { | ||
var mark_1 = (this.mark = new types_1.Id()); | ||
var prevDeps = this.deps; | ||
var mark = (this.mark = new types_1.Id()); | ||
this.prevDeps = this.deps; | ||
this.pdi = 0; | ||
this.deps = []; | ||
@@ -94,8 +95,8 @@ if (!this.isObserved && runtime_1.runtime.currentAtom) { | ||
runtime_1.runtime.currentAtom = prev; | ||
prevDeps.forEach(function (t) { | ||
var a = t.a; | ||
if (a.m !== mark_1) | ||
(0, shared_1.removeAtom)(a, _this); | ||
for (var i = this.pdi, d = this.prevDeps, s = d.length; i < s; i++) { | ||
var a = d[i].a; | ||
if (a.m !== mark) | ||
(0, shared_1.removeAtom)(a, this); | ||
a.readFlag = false; | ||
}); | ||
} | ||
this.deps.forEach(function (t) { | ||
@@ -129,2 +130,7 @@ var a = t.a; | ||
} | ||
var pd = this.prevDeps; | ||
var pdi = this.pdi; | ||
if (pdi < pd.length && pd[pdi].a === a) { | ||
this.pdi++; | ||
} | ||
var tr = { a: a, v: v, t: t }; // literal is faster than class | ||
@@ -131,0 +137,0 @@ a.m = mark; |
{ | ||
"name": "@dhmk/atom", | ||
"version": "2.0.1-test.13", | ||
"version": "2.0.1-test.14", | ||
"description": "Lightweight mobx-like observable values, computed values and side-effects", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
76603
1997