lodash-id icon indicating copy to clipboard operation
lodash-id copied to clipboard

mixin with lodash-es

Open fritx opened this issue 3 years ago • 0 comments

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())

fritx avatar Nov 09 '22 11:11 fritx