Skip to content

Instantly share code, notes, and snippets.

View Fran-A-Dev's full-sized avatar
🤓
Jamstacking

Fran Agulto Fran-A-Dev

🤓
Jamstacking
View GitHub Profile
@Fran-A-Dev
Fran-A-Dev / authors.js
Last active February 7, 2024 16:17
Single Authors Page Exampe/Faust.js wp-template
import { gql } from "@apollo/client";
import { useFaustQuery } from "@faustwp/core";
import { useRouter } from "next/router";
import {
Container,
ContentWrapper,
EntryHeader,
FeaturedImage,
Footer,
Header,
@Fran-A-Dev
Fran-A-Dev / react-streaming-example.jsx
Created April 19, 2024 15:40
Next.js 14 Core Competencies/3 second latency fetch
async function getCharacters() {
// Simulate 3 seconds of network latency
await new Promise((resolve) => setTimeout(resolve, 3000));
const res = await fetch("http://localhost:4000/characters", {
headers: {
"Content-Type": "application/json", // Indicate that we're expecting JSON
},
next: {
revalidate: 0, // Next.js specific fetch option to opt out of cache