Skip to content

Instantly share code, notes, and snippets.

@ReallyBadNews
Last active May 18, 2021 15:05
Show Gist options
  • Save ReallyBadNews/0c04a385f21999150bbcd80edb04c006 to your computer and use it in GitHub Desktop.
Save ReallyBadNews/0c04a385f21999150bbcd80edb04c006 to your computer and use it in GitHub Desktop.
const AmpOutputType = props => {
...
};
// Does not work
AmpOutputType.transform = {
amp({ data }) {
let newData = data;
// magic happens here
return {
data: newData,
};
},
};
// Creates `newAmp` output type
AmpOutputType.transform = {
newAmp({ data }) {
let newData = data;
// magic happens here
return {
data: newData,
};
},
};
// Does not add `amp` as a fallback to `newAmp`
AmpOutputType.fallback = ["amp", "default"];
export default AmpOutputType;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment