Giter VIP home page Giter VIP logo

Comments (6)

izaakschroeder avatar izaakschroeder commented on June 18, 2024

There are some features that lo-dash has that are very convenient, in particular the _.find function (and soon the _.isMatch function when v3.0.0 lands). I admit that I could use less of lo-dash by simply requiring the modules for each associated function (e.g. require('lodash/find') instead of the full require('lodash').

The only problem with your PR using native is that you will also have to provide an implementation of _.find which, using where-style matching, is probably non-trivial.

Thoughts?

from auth-header.

knownasilya avatar knownasilya commented on June 18, 2024

@izaakschroeder I agree, and requiring only the methods that you use would be a good alternative. Plus some the methods aren't really needed, you could use typeof and other JS features instead.

Why would _.find have anything to do with map/filter, which are native? _.find will still work perfectly fine if you don't use _.map/_.filter.

from auth-header.

izaakschroeder avatar izaakschroeder commented on June 18, 2024

Why would _.find have anything to do with map/filter, which are native? _.find will still work perfectly fine, if you replace [...] _.map/_.filter.

Yes! This is true. I feel like it's better to be consistent and performant in this case though; as heavy as lo-dash feels, it still actually outperforms native by a reasonable amount: http://jsperf.com/native-for-loop-vs-array-foreach-and-array-map-vs-lodas.

With that in mind I think the best solution going forward is to use individual function modules (e.g. require('lodash/foo') as opposed to entire lo-dash, but I don't think throwing lo-dash out is going to be on the table, including _.map and _.filter.

from auth-header.

knownasilya avatar knownasilya commented on June 18, 2024

I'm fine with that, since it's your call 😄

from auth-header.

izaakschroeder avatar izaakschroeder commented on June 18, 2024

It's been a long time 😄 but lodash is no more! #13

from auth-header.

knownasilya avatar knownasilya commented on June 18, 2024

Nice!

from auth-header.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.