No need for duplicate runParam
This commit is contained in:
parent
ca6dfb8891
commit
cac220a127
@ -9,7 +9,7 @@ export function computed(fn, dependencies = [], hash = id) {
|
||||
// Compute new value, call subscribers if changed.
|
||||
const accessor = function _computed() {
|
||||
if (isDirty) {
|
||||
const newVal = fn.apply(null, dependencies.map(runParam));
|
||||
const newVal = fn.apply(null, dependencies.map(call));
|
||||
isDirty = false;
|
||||
const newId = hash(newVal);
|
||||
if (oldId !== newId) {
|
||||
@ -49,5 +49,3 @@ export function computed(fn, dependencies = [], hash = id) {
|
||||
|
||||
return accessor;
|
||||
}
|
||||
|
||||
const runParam = a => (typeof a === 'function' ? a() : a);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user