This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext, useEffect, useRef, useState } from "react"; | |
// Types | |
type Import<M> = () => Promise<M>; | |
/** | |
* Using a single hook without context. | |
* This is shorter but relies on the browser/webpack cache. | |
* | |
* @example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as path from "path"; | |
import * as zlib from "zlib"; | |
import { PassThrough } from "stream"; | |
import * as functions from "firebase-functions"; | |
import * as admin from "firebase-admin"; | |
import * as log from "firebase-functions/lib/logger"; | |
import * as sharp from "sharp"; | |
import { empty } from "ramda"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as functions from "firebase-functions"; | |
import * as admin from "firebase-admin"; | |
import * as sharp from "sharp"; | |
// Just a list of all of the formats supported by Sharp | |
const SHARP_FORMATS = Object.values(sharp.format); | |
export const dynamicImages = functions.https.onRequest(async (request, response) => { | |
// From the URL we want to get our passed parameters |