Conveniently transforms values in an object using the This-Binding syntax.
Conveniently transforms values in an object using the This-Binding syntax.
This is a free-method version of mapValues
that applies the this
argument first, then the function it takes as argument. It's meant to
be used with the This-Binding Syntax proposal:
const map = require('folktale/core/object/map-values').infix;
const pair = { x: 10, y: 20 };
pair::map(x => x * 2);
// ==> { x: 20, y: 40 }
function(transformation) {
return mapValues(this, transformation);
}