question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use specific lodash library instead of underscore

See original GitHub issue

Currently, the component is using the full underscore. Would it be possible to remove the unnecessary functions and only use and import the specific functions from lodash instead?

Maybe only throttle would be needed.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tommoorcommented, Aug 17, 2016

Ah, interesting - no problem, I’ll make that change for the next release.

On Tue, Aug 16, 2016 at 7:21 PM, Tommy notifications@github.com wrote:

Yep, but you’re using the syntax import {throttle, each, map, compact} from ‘lodash’, so the entire “lodash” library is loaded, which is a bit overkill for only 4 functions used.

Instead, you could use import throttle from ‘lodash/throttle’, … for every functions. Or use the babel plugin as I specified.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tommoor/emojione-picker/issues/20#issuecomment-240296062, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXP8sBgWbMehnD8uOS4eBNyyTJZawuKks5qgnAsgaJpZM4IJQZ- .

Tom Moor

http://tommoor.com http://twitter.com/tommoor

0reactions
tleunencommented, Aug 17, 2016

Yep, but you’re using the syntax import {throttle, each, map, compact} from 'lodash', so the entire “lodash” library is loaded, which is a bit overkill for only 4 functions used.

Instead, you could use import throttle from 'lodash/throttle', … for every function. Or use the babel plugin as I specified.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Difference between lodash and Underscore - GeeksforGeeks
The lodash and UnderScore both are utility libraries from JavaScript which helps make it easier by providing utils which makes, working with ...
Read more >
Differences between Lodash and Underscore.js - Stack Overflow
Underscore _.groupBy supports an iteratee that is passed the parameters (value, index, originalArray) , while in Lodash, the iteratee for _.
Read more >
you-dont-need/You-Dont-Need-Lodash-Underscore - GitHub
Lodash and Underscore are great modern JavaScript utility libraries, ... by a key in an object you must use x => x.key instead...
Read more >
Lodash tutorial - introducing JavaScript Lodash library - ZetCode
By convention, Lodash module is mapped to the underscore character. Lodash installation. First, we install the Lodash library. $ npm init -y $ ......
Read more >
Lodash in 2022: necessary or obsolete? - Nico Zerpa
If you have a couple of years as a developer, you've probably used either Lodash or Underscore.js. These are two libraries that provide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found