mixanator
v1.0.7
Published
Mixins through function composition
Downloads
6
Maintainers
Readme
Mixanator
Mixins with function composition
Usage
import { mix } from 'mixanator';
const User = mix(({ name }) => ({ name, updatedAt: new Date() }))
const Student = User.extend(({ name, id }) => ({ ...user, id, }))
//...
const u = User({name: 'Adam'}) // { name: 'adam' }
const s = Student({ name: 'Adam', id: 12 }) // { name: adam, id: 12 }