Closed kurtpeters closed 7 years ago
I noticed the last two commented outputs from the "simplest example" are incorrect. Since the initializer is destructuring the argument
const MyStamp = stampit() // create new empty stamp .props({ // add properties to your future objects myProp: 'default value' }) .methods({ // add methods to your future objects getMyProp() { return this.myProp; } }) .init(function ({value}) { // add initializers to your future objects this.myProp = value || this.myProp; })
should the following
console.log(MyStamp('new value')); // { myProp: 'new value' } console.log(MyStamp('new value').getMyProp()); // new value
be documented to reflect to the destructuring from the initializer?
console.log(MyStamp({value: 'new value'})); // { myProp: 'new value' } console.log(MyStamp({value: 'new value'}).getMyProp()); // new value
Good catch, thanks! Would you mind creating the PR?
No problem! Here's the PR - https://github.com/stampit-org/stampit/pull/274
I noticed the last two commented outputs from the "simplest example" are incorrect. Since the initializer is destructuring the argument
should the following
be documented to reflect to the destructuring from the initializer?