Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More performant compact map #344

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dubiousdavid
Copy link
Member

  • More performant compact map.
  • Fix stuff Babel was complaining about.

@decrapifier
Copy link
Contributor

decrapifier commented Feb 21, 2022

Warnings
⚠️ The README has not been updated. Please update the README.
Messages
📖 Your PR has no browser errors. Great job!

Generated by 🚫 dangerJS against bb1228c

package.json Show resolved Hide resolved
export let compactMap = _.curry((fn, collection) =>
_.flow(_.map(fn), _.compact)(collection)
)
export let compactMap = _.curry((iteratee, collection) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do a quick benchmark? Lodash supports shortcut fusion which should be effectively the same thing. My first feedback was gonna be to do this with transducers https://runkit.com/daedalus28/transducer-example but lodash does this automatically in some cases - might only be only explicit chain calls though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fusion is only supported in the chain scenario. https://lodash.com/docs/4.17.15#lodash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants