Skip to content
James edited this page May 29, 2017 · 4 revisions

extend

  • .debug is built into ChainedMapExtendable 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)
  }
}

extendAlias

chain.extendAlias(['eh'], 'canada')
chain.eh == chain.canada

extendFalse

chain.extendTrue(['lies']).lies().get('lies') === false

extendTrue

chain.extendTrue(['truth']).truth().get('truth') === true

extendIncrement

chain.extendIncrement(['index']).index().index().index()
chain.get('index') === 3
Clone this wiki locally