Skip to content

Instantly share code, notes, and snippets.

#pragma once
#include <exception>
#include <coroutine>
#include <atomic>
#include <functional>
#include <iostream>
template<typename T>
fetch('https://api.gazatu.xyz/trivia/questions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
category: 'TEST_CATEGORY',
question: 'TEST_QUESTION',
answer: 'TEST_ANSWER',
hint1: 'TEST_HINT1', // nullable
import * as React from 'react';
import Axios, { AxiosInstance } from 'axios';
import { createContext, consume } from '../lib/context-utils';
import { AuthContext } from './AuthProvider';
export const ApiContext = createContext('apiContext', {
api: undefined as AxiosInstance | undefined,
auth: undefined as React.ContextType<typeof AuthContext> | undefined,
})
import * as React from 'react';
import { createContext } from '../lib/context-utils';
interface User {
[key: string]: any // idk yet
}
interface Auth {
token: string
user: User