Skip to content

Commit

Permalink
fix(query-runner): replace .off with .removeListener (#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 #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 #1234, Addresses #1234, Related to #1234, etc.
-->
Related to #10612
  • Loading branch information
wKovacs64 authored and DSchau committed Dec 21, 2018
1 parent f288faa commit ed5e5d5
Showing 1 changed file with 1 addition and 1 deletion.
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 ed5e5d5

Please sign in to comment.