Skip to content

Conversation

@dubiousdavid
Copy link
Member

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

@dubiousdavid dubiousdavid self-assigned this Feb 21, 2022
@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

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.

5 participants