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
#.... | |
plugins: | |
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | |
spec: '@yarnpkg/plugin-workspace-tools' | |
- .yarn/plugins/ts-referent-plugin.cjs ### ⬅️ ⬅️ ⬅️ ⬅️ |
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 { Worker } from "worker_threads"; | |
import type { Compiler, compilation, Plugin } from "webpack"; | |
interface Options { | |
name: string; | |
require?: string[]; | |
keyboard?: boolean; | |
} |
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 { useState, useEffect } from 'react'; | |
type UseResizeObserverCallback = (ref: Element) => void; | |
type ResizeObserverCallback = ( | |
entries: IResizeObserverEntry[], | |
observer: ResizeObserver, | |
) => void; | |
interface IResizeObserverEntry { |
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 from "react"; | |
import { withRouter } from "react-router-dom"; | |
import { getPageScroll, scrollTo } from "./utils"; | |
const ScrollContext = React.createContext(new Map()); | |
const getLocationKey = location => `${location.pathname}?${location.search}`; | |
const ScrollMemory = ({ children, history: _history, location }) => { |
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
const initial = {}; | |
const fetchMachine = Machine({ | |
id: 'panel', | |
initial: 'waiting', | |
context: initial, | |
states: { | |
waiting: { | |
// always reset to initial context | |
entry: assign(() => null), | |
on: { |
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
const fs = require("fs"); | |
const gzipSize = require("gzip-size"); | |
const stats = require("../build/imported"); | |
function collectSize(assets) { | |
return assets.reduce((acc, asset) => acc + (stats.assets.find(({ name }) => name === asset) || { size: 0 }).size, 0); | |
} | |
function collectGSize(assets) { |
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
"use strict"; | |
exports.__esModule = true; | |
exports.default = void 0; | |
var _pluginSyntaxDynamicImport = _interopRequireDefault(require("@babel/plugin-syntax-dynamic-import")); | |
var _chunkName = _interopRequireDefault(require("./properties/chunkName")); | |
var _isReady = _interopRequireDefault(require("./properties/isReady")); |
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
// see cloudflare workers - https://workers.cloudflare.com | |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndStream(event.request)) | |
}) | |
async function fetchAndStream(request) { | |
let streamResponse = fetch(request); // dont await, as majority of CF examples do | |
let { readable, writable } = new TransformStream() |
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 React from 'react'; | |
import * as ReactDOM from 'react-dom'; | |
import { createChannel } from 'react-push-channel'; | |
function setDescription(description: string) { | |
const meta = document.querySelector('meta[name=description]') || document.createElement('meta'); | |
meta.setAttribute('name', 'description'); | |
meta.setAttribute('content', description); | |
document.head!.appendChild(meta); | |
} |
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 {useState, useEffect, useLayoutEffect, useRef} from "react"; | |
const getMouseCoords = (e) => [e.clientX, e.clientY]; | |
const useDragHandle = (ref) => { | |
const [mouseDown, setMouseDown] = useState(null); | |
const [initialScroll, setInitialScroll] = useState(null); | |
useEffect(() => { | |
const {current: container} = ref; |
NewerOlder