chainprops
v0.0.1-alpha.1
Published
Super simple chaining function.
Downloads
6
Readme
ChainProps
Super simple chaining function.
Example:
const Chain = require('chainprops');
const CoolObject = {
method1(name) {
console.log("wow, right " + name + "?")
},
method2() {
console.log("so cool")
},
prop1: 'Thing',
prop2: 'Thing2'
};
new Chain(CoolObject)
.callMethod('method1', "John")
.callMethod('method2')
.setProp('prop1', 'Another')
.setProp('prop2', 'Another2');
//prop1 is "Another", and prop2 is "Another2"
// output is:
// wow, right John?
// so cool