Skip to content

Instantly share code, notes, and snippets.

@koresar
Created February 9, 2017 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koresar/6dccfdfa0b8b740cadfda72ac6ab831d to your computer and use it in GitHub Desktop.
Save koresar/6dccfdfa0b8b740cadfda72ac6ab831d to your computer and use it in GitHub Desktop.
Fun with stamps. Episode 12
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