No need for duplicate runParam

This commit is contained in:
Timothy Farrell 2018-05-31 15:46:33 -05:00
parent 6209aae878
commit b2de97f2b3

View File

@ -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);