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

Bugfix: Prevent double-prefixing when using combineActions #334

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.

test/handleActions.test.js Outdated Show resolved Hide resolved
@timche
Copy link
Member

timche commented Feb 18, 2019

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

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