Skip to content

Commit

Permalink
callback isn't needed
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerBarnes committed Mar 24, 2023
1 parent 72d4373 commit 7ff48c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions packages/gatsby/src/redux/reducers/inference-metadata.ts
Expand Up @@ -37,15 +37,13 @@ const incrementalReducer = (

case `BUILD_TYPE_METADATA`: {
// Overwrites existing metadata
const { nodes, typeName, clearExistingMetadata, callback } =
action.payload
const { nodes, typeName, clearExistingMetadata } = action.payload
if (!state[typeName]?.ignored) {
const initialMetadata = clearExistingMetadata
? initialTypeMetadata()
: state[typeName]

state[typeName] = addNodes(initialMetadata, nodes)
callback()
}
return state
}
Expand Down
1 change: 0 additions & 1 deletion packages/gatsby/src/redux/types.ts
Expand Up @@ -1058,7 +1058,6 @@ interface IBuildTypeMetadataAction {
nodes: Array<IGatsbyNode>
clearExistingMetadata: boolean
typeName: string
callback: () => void
}
}

Expand Down
12 changes: 6 additions & 6 deletions packages/gatsby/src/schema/index.js
Expand Up @@ -74,14 +74,14 @@ const buildInferenceMetadata = ({ types }) =>
// only clear metadata on the first chunk for this type
clearExistingMetadata: dispatchCount++ === 0,
nodes: processingNodes,
callback: () => {
processingNodes = []
setImmediate(() => {
res(null)
})
},
},
})
setImmediate(() => {
processingNodes = []
setImmediate(() => {
res(null)
})
})
})
}

Expand Down

0 comments on commit 7ff48c7

Please sign in to comment.