-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
A common pattern I've noticed is:
transmute({ roar: 'test' })
.extend('afterChange', snowball =>
func({ ...snowball, differentName: snowball.roar })
)
It should be something more like:
transmute({ roar: 'test' })
.extend('afterChange',
alter('roar', 'differentName')(func)
)
transmute({ roar: 'test', dude: 'stuff' })
.extend('afterChange',
alter(
['roar', 'dude'],
['differentName', 'betterName'],
func
)
)
Maybe... might be powerful. Not really a fan of the syntax yet, but would be interesting. Alternatively a solid thing would be a babel plugin that allows this:
transmute({ roar: 'test' })
.extend('afterChange', (snowball: { roar: differentName }) =>
func({ ...snowball, differentName })
)
Destructuring on positional arguments. Just some thoughts.
Metadata
Metadata
Assignees
Labels
No labels