composable-dot-box
v1.0.4
Published
<h3 style="margin:0; padding:0">Object:</h3> The "composable-dot-box" object allows you to wrap your data in composable and immutable getters and setters. <p>Composability is a system design principle that deals with the inter-relationships of componen
Downloads
4
Readme
example 2: dealing with object
const myData = {
firstName: 'Matt',
middleName: 'CP',
lastName: 'Chen',
height: '6\'',
weight: '165',
location: 'New York'
};
const myHealthStatus = DotBox
.of(myData)
.map(data => ({
name: data.firstName +' '+data.middleName +' '+data.lastName,
weight: data.weight
}))
.map(data => {
const name = data.name;
const isFatorNot = Number(data.weight)>160? 'fat' : 'skinny';
return name + ', you are too ' + isFatorNot;
})
.print();
// Matt CP Chen, you are too fat