factor-in
![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)
A factory of factory functions. Share and extend object data.
Install
$ npm install --save factor-in
Usage
import factorIn from 'factor-in'
const f = factorIn ({
foo () {},
bar () {}
})
var obj = f ({ baz: 'Baz', qux: 'Qux' })
test('Demo component', nest => {
const fixture = factorIn({
setWord () {},
setMode () {}
})
nest.test('...with basic fixture', t => {
const el = <Hello actions={ fixture() } />
t.equal(actual, expected, 'should have common methods')
t.end()
})
nest.test('...with extended fixture', t => {
const extendedFixture = fixture({ setAction () {} })
const el = <Hello actions={ extendedFixture } />
t.equal(actual, expected, 'should have common and extended methods')
t.end()
})
})
License
MIT © Chris Buttery