-
Couldn't load subscription status.
- Fork 8
Extend
James edited this page May 30, 2017
·
4 revisions
Extend 🎼
easy extension, debugging, and decorating factories
.debug is built into Extend, it's a unique property
- available with
.get('debug'), - settable by
.debug(boolean | string | any), -
is not in the .store so it will not affect
.entriesor other functions
chain.extendAlias(['eh'], 'canada')
chain.eh == chain.canadachain.extendIncrement(['index']).index().index().index()
chain.get('index') === 3with an object
chain.extendWith({thing1: 'dr', thing2: 'dr'})
const {thing1, thing2} = chain.thing1().thing2().entries()
thing1 === 'dr'
thing1 === thing2with an array and a value
chain.extendWith(['thing1', 'thing2'], 'dr')
const {thing1, thing2} = chain.thing1().thing2().entries()
thing1 === 'dr'
thing1 === thing2chain.extendWith(['truth'], true).truth().get('truth') === truechain.extendWith(['lies'], false).lies().get('lies') === false