stampit-org / stamp

Stamps - better OOP model
https://stampit.js.org
MIT License
25 stars 3 forks source link

staticPropertyDescriptors vs staticDeepProperties #50

Closed mlrsoft closed 5 years ago

mlrsoft commented 5 years ago

In the stampit API, under Static property descriptors, the examples shows:

let MyStamp = stampit() // empty stamp creates empty objects

MyStamp.name === 'Stamp' // every stamp default name is "Stamp"

MyStamp = MyStamp.staticDeepProperties({
  name: { value: 'MyStamp' } // this meta data will be applied just after composition, i.e. immediately
})

MyStamp.name === 'MyStamp'

I think it should be

let MyStamp = stampit() // empty stamp creates empty objects

MyStamp.name === 'Stamp' // every stamp default name is "Stamp"

MyStamp = MyStamp.staticPropertyDescriptors({
  name: { value: 'MyStamp' } // this meta data will be applied just after composition, i.e. immediately
})

MyStamp.name === 'MyStamp'

The same goes for the examples under Other ways to add static property descriptors

koresar commented 5 years ago

Thank you very much for the issue.

A moment ago I found that Gitbook have blocked my account! I can't edit anything until I pay. Although, I'm on a free plan and they promised me that stampit OSS project will be always free.

I'll fix it as soon as they unblock my account.

koresar commented 5 years ago

Fixed. 👍