Created
February 9, 2017 02:43
-
-
Save koresar/6dccfdfa0b8b740cadfda72ac6ab831d to your computer and use it in GitHub Desktop.
Fun with stamps. Episode 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import compose from '@stamp/compose'; | |
import Privatize from '@stamp/privatize'; | |
import Collision from '@stamp/collision'; | |
const Password = compose({ | |
properties: { | |
password: '12345qwert' | |
}, | |
methods: { | |
getPassword() { | |
return this.password; | |
}, | |
setPassword(pwd) { | |
this.password = pwd; | |
} | |
} | |
}) | |
.compose(Privatize) // Privatizing all the properties by default | |
.privatizeMethods('getPassword') // Privatize the method | |
.compose(Collision).collisionSetup({ | |
forbid: ['getPassword', 'setPassword'] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment