Skip to content

Instantly share code, notes, and snippets.

@yoadsn
Created November 29, 2016 15:38
Show Gist options
  • Select an option

  • Save yoadsn/c9399ab6b3c2143eb324b99320c46020 to your computer and use it in GitHub Desktop.

Select an option

Save yoadsn/c9399ab6b3c2143eb324b99320c46020 to your computer and use it in GitHub Desktop.
import Prismic, { Document } from 'prismic.io';
...
let api = await Prismic.api("http://wescover-repo.prismic.io/api");
let document = await api.getByUID('homepage', 'homepage');
let asJson = JSON.stringify(document);
let asObject = JSON.parse(asJson);
let backToDoc = new Document(
asObject.id,
asObject.uid,
asObject.type,
asObject.href,
asObject.tags,
asObject.slugs,
asObject.firstPublicationDate,
asObject.lastPublicationDate,
asObject.data);
deepCopmpare(document, backToDoc) // true?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment