Skip to content

Tag: lodash

Conditionally concatenate in reducer using lodash

I try to conditionally concat in my reducer, I have an array objects and I want to concatenate only if value not exist in my reducer. If value exists nothing must happen. I use lodash and I tried with _.uniqBy like this : This does not work. Example of my reducer jsFiddle linkk Required output […]

How to Import a Single Lodash Function?

Using webpack, I’m trying to import isEqual since lodash seems to be importing everything. I’ve tried doing the following with no success: Answer You can install lodash.isequal as a single module without installing the whole lodash package like so: When using ECMAScript 5 and CommonJS modules, you then import it like this: Using ES6 modules, this would be: And you