lodash-id
lodash-id copied to clipboard
mixin with lodash-es
Just found out a solution: https://stackoverflow.com/questions/45462193/how-to-use-chain-with-lodash-es-while-supports-tree-shaking/72983877#72983877
Maybe should be added to documentation?
import lodashId from 'lodash-id'
import { mixin, chain, wrapperLodash } from 'lodash-es'
// doesn't work
mixin(lodashId)
// works
mixin(wrapperLodash, lodashId)
// test cases
console.log(chain([]).head)
console.log(chain([]).insert)
console.log(chain([]).insert({a:1}).value())