Skip to content

Cleanup some of the dependency imports#1327

Merged
megawac merged 1 commit intomasterfrom
lib-import-cleanups
Nov 17, 2016
Merged

Cleanup some of the dependency imports#1327
megawac merged 1 commit intomasterfrom
lib-import-cleanups

Conversation

@megawac
Copy link
Copy Markdown
Collaborator

@megawac megawac commented Nov 17, 2016

Saves 800 bytes on min.js

fyi _baseRest imports a bunch of string manipulation code to manage setting func.toString on the output function

Saves 800 bytes on min.js

export default function _asyncMap(eachfn, arr, iteratee, callback) {
callback = once(callback || noop);
callback = callback || noop;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't we need once here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

nope, each/eachLimit/eachSeries gaurentee that we'll only ever be calling callback once

if (isArray(taskFn)) {
params = clone(taskFn);
taskFn = params.pop();
params = taskFn.slice(0, -1);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TIL slice can take negative indexes.

@megawac megawac merged commit b464768 into master Nov 17, 2016
@megawac megawac deleted the lib-import-cleanups branch November 17, 2016 22:48
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.

2 participants