infix

Conveniently transforms values in an object using the This-Binding syntax.

Signature

infix(transformation)
(Object 'a) . (('a) => 'b) => Object 'b

Documentation

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 }

Properties

Source Code

function(transformation) {
  return mapValues(this, transformation);
}
Stability
stable
Licence
MIT
Module
folktale/core/object/map-values
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)