@goldfishjs/reactive
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -90,2 +90,4 @@ import _typeof from "@babel/runtime/helpers/typeof"; | ||
removeListenersGroup.push(removeFns); | ||
}, function (error) { | ||
throw error; | ||
}); | ||
@@ -92,0 +94,0 @@ } |
{ | ||
"name": "@goldfishjs/reactive", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Reactive.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -86,23 +86,28 @@ import { call, getCurrent, Dep, DepList } from './dep'; | ||
if (isDirty) { | ||
call(() => { | ||
cachedValue = realGetter(); | ||
depList = getCurrent(); | ||
depMap[key] = depList; | ||
call( | ||
() => { | ||
cachedValue = realGetter(); | ||
depList = getCurrent(); | ||
depMap[key] = depList; | ||
removeListenersGroup.forEach(group => group.forEach(fn => fn())); | ||
removeListenersGroup = []; | ||
removeListenersGroup.forEach(group => group.forEach(fn => fn())); | ||
removeListenersGroup = []; | ||
const removeFns = depList.addChangeListener( | ||
() => { | ||
isDirty = true; | ||
dep.notifyChange(undefined, cachedValue, { | ||
type: 'computed', | ||
isChanged: () => true, | ||
}); | ||
}, | ||
false, | ||
); | ||
isDirty = false; | ||
removeListenersGroup.push(removeFns); | ||
}); | ||
const removeFns = depList.addChangeListener( | ||
() => { | ||
isDirty = true; | ||
dep.notifyChange(undefined, cachedValue, { | ||
type: 'computed', | ||
isChanged: () => true, | ||
}); | ||
}, | ||
false, | ||
); | ||
isDirty = false; | ||
removeListenersGroup.push(removeFns); | ||
}, | ||
(error) => { | ||
throw error; | ||
}, | ||
); | ||
} | ||
@@ -109,0 +114,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
51859
1649
0