Skip to content

Bugfix: Prevent double-prefixing when using combineActions #334

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Feb 18, 2019

Conversation

SuaYoo
Copy link
Contributor

@SuaYoo SuaYoo commented Nov 20, 2018

Using the prefix option in conjunction with combineActions will prefix the combined action type again. For example:

const options = { prefix: 'my-prefix' };
const { action1, action2 } = createActions('ACTION_1', 'ACTION_2', options)

const combinedActionType = combineActions(action1, action2).toString()

console.log(combinedActionType)
// "my-prefix/my-prefix/ACTION_1||my-prefix/ACTION_2"

This PR fixes the issue by checking if the action type string already starts with the prefix + namespace.

@codecov
Copy link

codecov bot commented Nov 20, 2018

Codecov Report

Merging #334 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #334   +/-   ##
=======================================
  Coverage   96.92%   96.92%           
=======================================
  Files          28       28           
  Lines         130      130           
  Branches       39       39           
=======================================
  Hits          126      126           
  Misses          3        3           
  Partials        1        1
Impacted Files Coverage Δ
src/utils/flattenWhenNode.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6daa0c0...f3ce139. Read the comment docs.

@timche
Copy link
Member

timche commented Feb 18, 2019

Sorry for the long waiting. Thank you very much 🙏 👏

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

Successfully merging this pull request may close these issues.

2 participants