This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
dns2019/gatsby-browser.js
2019-08-05 00:59:54 +02:00

30 lines
578 B
JavaScript

/* global twttr instgrm */
const loadTwitter = () => {
if (
typeof twttr !== `undefined` &&
twttr.widgets &&
typeof twttr.widgets.load === `function`
) {
twttr.widgets.load(document.getElementById('___gatsby'))
}
}
const processInstagram = () => {
if (
typeof instgrm !== `undefined` &&
instgrm.Embeds &&
typeof instgrm.Embeds.process === `function`
) {
instgrm.Embeds.process()
}
}
const initScripts = () => {
loadTwitter()
processInstagram()
}
exports.onInitialClientRender = initScripts
exports.onRouteUpdate = initScripts