Skip to content

Instantly share code, notes, and snippets.

@vladar
Created September 7, 2020 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladar/f7c5dca0f3c7a0c472c3f86c19f71656 to your computer and use it in GitHub Desktop.
Save vladar/f7c5dca0f3c7a0c472c3f86c19f71656 to your computer and use it in GitHub Desktop.
onPreInit bug
exports.onPreInit = (gatsbyApi, pluginOptions) => {}
exports.sourceNodes = async (gatsbyApi) => {
const {cache, reporter} = gatsbyApi
reporter.info('Testing cache');
reporter.info(await cache.get('test'));
reporter.info('Setting cache');
await cache.set('test', 'someValue');
reporter.info('Checking if set succesfully');
reporter.info(await cache.get('test'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment