UNPKG

gatsby-source-contentful

Version:

Gatsby source plugin for building websites using the Contentful CMS as a data source

13 lines (12 loc) 448 B
"use strict"; exports.__esModule = true; exports.untilNextEventLoopTick = untilNextEventLoopTick; // When iterating on tons of objects, we don't want to block the event loop // this helper function returns a promise that resolves on the next tick so that the event loop can continue before we continue running blocking code function untilNextEventLoopTick() { return new Promise(res => { setImmediate(() => { res(null); }); }); }