Skip to content

Commit

Permalink
fix(query-runner): replace .off with .removeListener (gatsbyjs#10613)
Browse files Browse the repository at this point in the history
<!--
  Have any questions? Check out the contributing docs at https://gatsby.app/contribute, or
  ask in this Pull Request and a Gatsby maintainer will be happy to help :)
-->

## Description

<!-- Write a brief description of the changes introduced by this PR -->
This fixes a bug introduced in gatsbyjs#10593 by replacing the `.off` call with `.removeListener`. `.off` was introduced in Node v10.0.0 as an alias for `.removeListener` (nodejs/node#17156).

## Related Issues

<!--
  Link to the issue that is fixed by this PR (if there is one)
  e.g. Fixes gatsbyjs#1234, Addresses gatsbyjs#1234, Related to gatsbyjs#1234, etc.
-->
Related to gatsbyjs#10612
  • Loading branch information
wKovacs64 authored and gpetrioli committed Jan 22, 2019
1 parent 3fddda7 commit d3a6427
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const runQueriesForPathnames = pathnames => {

return new Promise(resolve => {
const onDrain = () => {
queue.off(`drain`, onDrain)
queue.removeListener(`drain`, onDrain)
resolve()
}
queue.on(`drain`, onDrain)
Expand Down

0 comments on commit d3a6427

Please sign in to comment.