Skip to content

Commit

Permalink
Avoid hook recursion when adding all hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Silverstein committed May 1, 2019
1 parent adda6d7 commit 42659b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/hooks/src/createRunHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function createRunHook( hooks, returnFirstArg ) {
// The following code can be stripped from production builds.
/* develblock:start */
// Handle any 'all' hooks registered.
if ( hooks.all ) {
handlers.push( hooks.all.handlers );
if ( 'hookAdded' !== hookName && hooks.all ) {
handlers.push( ...hooks.all.handlers );
}
/* develblock:end */

Expand Down

0 comments on commit 42659b9

Please sign in to comment.