Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

Hooks: Fix undefined first argument on consecutive action callbacks #90

Merged
merged 1 commit into from
Mar 21, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Mar 16, 2018

Regression introduced in #85
Related: WordPress/gutenberg#5588

This pull request seeks to resolve an issue where all but the first action callbacks will receive undefined first argument. This is caused by an intended simplification of the first argument assignment in the createRunHook.js file. However, this treated actions as the same as filters, thus because most actions do not define a return value, the argument would become unset.

Testing instructions:

Verify unit tests pass:

npm test

@aduth aduth changed the title Hooks: Fix undefined arguments on consecutive action callbacks Hooks: Fix undefined first argument on consecutive action callbacks Mar 16, 2018
@codecov
Copy link

codecov bot commented Mar 16, 2018

Codecov Report

Merging #90 into master will increase coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
+ Coverage   73.45%   73.57%   +0.12%     
==========================================
  Files          35       35              
  Lines         437      439       +2     
  Branches       82       83       +1     
==========================================
+ Hits          321      323       +2     
  Misses         98       98              
  Partials       18       18
Impacted Files Coverage Δ
packages/hooks/src/createRunHook.js 94.73% <100%> (+0.61%) ⬆️

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 95dc85c...ade460f. Read the comment docs.

@aduth aduth force-pushed the fix/action-undef branch from e2c6673 to 2417dbc Compare March 21, 2018 19:28
@aduth aduth force-pushed the fix/action-undef branch from 2417dbc to ade460f Compare March 21, 2018 19:30
@aduth aduth merged commit 6be1af4 into master Mar 21, 2018
@aduth aduth deleted the fix/action-undef branch March 21, 2018 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant