Skip to content

Remove lodash.reduce, lodash.camelCase #166

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

Merged
merged 13 commits into from
Jan 26, 2017
Merged

Remove lodash.reduce, lodash.camelCase #166

merged 13 commits into from
Jan 26, 2017

Conversation

yangmillstheory
Copy link
Contributor

@yangmillstheory yangmillstheory commented Nov 19, 2016

Going from

redux-actions git:(master) npm run build:umd:min

> [email protected] build:umd:min /Users/VictorAlvarez/code/private/redux-actions
> cross-env NODE_ENV=production webpack

Hash: 423ecf4d346ccf00b655
Version: webpack 1.13.1
Time: 2527ms
               Asset     Size  Chunks             Chunk Names
redux-actions.min.js  33.1 kB       0  [emitted]  main
    + 157 hidden modules
redux-actions git:(master)

to

redux-actions git:(camel-case) npm run build:umd:min

> [email protected] build:umd:min /Users/VictorAlvarez/code/private/redux-actions
> cross-env NODE_ENV=production webpack

Hash: 8168e6ff577773b7fc11
Version: webpack 1.13.1
Time: 1856ms
               Asset     Size  Chunks             Chunk Names
redux-actions.min.js  17.3 kB       0  [emitted]  main
    + 67 hidden modules

Also, I think it's useful to allow / when camel-casing (and not remove it). This would give users the ability to write namespaced actions (via helper code, e.g.) as in #159.

@yangmillstheory yangmillstheory changed the title Remove lodash.reduce, lodash.camelCase, pass forward-slash when camel-casing Remove lodash.reduce, lodash.camelCase, pass namespacer when camel-casing Nov 19, 2016
@yangmillstheory yangmillstheory changed the title Remove lodash.reduce, lodash.camelCase, pass namespacer when camel-casing Remove lodash.reduce, lodash.camelCase Nov 19, 2016
, '');
}

export default actionType => actionType.split(namespacer).map(camelCase).join(namespacer);
Copy link
Member

Choose a reason for hiding this comment

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

Let's use the camelCase function from sindresorhus: https://github.com/sindresorhus/camelcase

We could also put this file into a utils folders.

Copy link
Contributor Author

@yangmillstheory yangmillstheory Dec 4, 2016

Choose a reason for hiding this comment

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

That doesn't look like it honors delimiters like /. From the PR description

Also, I think it's useful to allow / when camel-casing (and not remove it). This would give users the ability to write namespaced actions (via helper code, e.g.) as in #159.

Honoring delimiters like / would make libraries such as https://github.com/yangmillstheory/redux-nested-actions useful.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Fine for me. We should only look if we really covered every possible case.

@ruiaraujo
Copy link

What is the progress on this? Looks good.

@yangmillstheory
Copy link
Contributor Author

Sorry about the delay! I agree this is mostly done, I'll update this and ship tonight.

@yangmillstheory yangmillstheory merged commit 4fc00f5 into master Jan 26, 2017
@yangmillstheory
Copy link
Contributor Author

@timche timche deleted the camel-case branch April 18, 2018 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants