factory
flatten :: Object specification => (Any, Any, ...) -> Objectdescription
examples
constant values
import { factory } from 'conductor'
const spec = { name: 'Elliot', type: 'hacker' }
const Hacker = factory(spec)
Hacker() // { name: 'Elliot', type: 'hacker' }function values
import { factory } from 'conductor'
const spec = { name: x => x, createdAt: () => Date.now() }
const Hacker = factory(spec)
Hacker('Elliot') // { name: 'Elliot', createdAt: 1529249582304 }nested specification
Last updated