-
Notifications
You must be signed in to change notification settings - Fork 8
Extend
James edited this page May 29, 2017
·
4 revisions
-
.debug
is built intoChainedMapExtendable
and all sub classes
class Chain extends Chainable {
constructor(parent) {
super(parent)
this.extend(['eh', 'canada'])
}
}
// doing the above is the same as
class Chain extends Chainable {
eh(arg) {
return this.set('eh', arg)
}
canada(arg) {
return this.set('canada', arg)
}
}
chain.extendAlias(['eh'], 'canada')
chain.eh == chain.canada
chain.extendTrue(['lies']).lies().get('lies') === false
chain.extendTrue(['truth']).truth().get('truth') === true
chain.extendIncrement(['index']).index().index().index()
chain.get('index') === 3