Skip to content

Commit

Permalink
Revert "fix(gatsby-transformer-remark): wait for async subplugins (#1…
Browse files Browse the repository at this point in the history
…2578)"

This reverts commit af87e96.
  • Loading branch information
wardpeet committed Mar 18, 2019
1 parent cfc5126 commit 59bc2b0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 37 deletions.
24 changes: 0 additions & 24 deletions packages/gatsby-transformer-remark/src/__tests__/utils.js

This file was deleted.

14 changes: 13 additions & 1 deletion packages/gatsby-transformer-remark/src/extend-node-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const {
cloneTreeUntil,
findLastTextNode,
} = require(`./hast-processing`)
const { eachPromise } = require(`./utils`)

let fileNodes
let pluginsCacheStr = ``
Expand Down Expand Up @@ -69,6 +68,19 @@ const safeGetCache = ({ getCache, cache }) => id => {
return getCache(id)
}

/**
* @template T
* @param {Array<T>} input
* @param {(input: T) => Promise<void>} iterator
* @return Promise<void>
*/
const eachPromise = (input, iterator) =>
input.reduce(
(accumulatorPromise, nextValue) =>
accumulatorPromise.then(() => void iterator(nextValue)),
Promise.resolve()
)

const HeadingType = new GraphQLObjectType({
name: `MarkdownHeading`,
fields: {
Expand Down
12 changes: 0 additions & 12 deletions packages/gatsby-transformer-remark/src/utils.js

This file was deleted.

0 comments on commit 59bc2b0

Please sign in to comment.