Ever changing implementations of pipes that I reimplement in each codebase for different use cases.
If you do want a package instead. You should go with this https://github.com/barelyhuman/pipe
Ever changing implementations of pipes that I reimplement in each codebase for different use cases.
If you do want a package instead. You should go with this https://github.com/barelyhuman/pipe
function useIsPendingPathname(to) { | |
let { location } = useTransition(); | |
let { pathname } = useResolvedPath(to); | |
return location?.pathname === pathname; | |
} | |
function useIsSlowTransition(ms = 300) { | |
let transition = useTransition(); | |
let [isSlow, setIsSlow] = useState(false); |
An important part of "routing" is handling redirects. Redirects usually happen when you want to preserve an old link and send all the traffic bound for that destination to some new URL so you don't end up with broken links.
The way we recommend handling redirects has changed in React Router v6. This document explains why.
In React Router v4/5 (they have the same API, you can read about why we had to bump the major version here) we had a <Redirect>
component that you could use to tell the router when to automatically redirect to another URL. You might have used it like this:
import React from "react"; | |
import NextLink, { LinkProps } from "next/link"; | |
/** | |
* Higher Order Component to turn any component with a href into a component that supports `next/link`. | |
* | |
* Pass the component props like this: | |
* @example const Button = withNextLink<ButtonProps>(MuiButton); | |
* TODO: Look into forwarding refs. | |
*/ |
import childProcess from 'child_process'; | |
import fs from 'fs'; | |
import dotenv from 'dotenv'; | |
import prettier from 'prettier'; | |
const rootDir = process.cwd(); | |
dotenv.config({ | |
path: `${rootDir}/.env.production`, | |
}); |
name: serverless-mono | |
description: Serverless mono infrastructure | |
backend: | |
url: s3://my-pulumi-state-bucket | |
runtime: | |
name: nodejs | |
options: | |
typescript: false | |
lock: | |
region: ap-southeast-2 |
I hereby claim:
To claim this, I am signing this object:
/** | |
* GTM utm_ remover | |
* License: MIT | |
* Author: @CanRau | |
* Version: 0.2.0 | |
* | |
* Removes all query parameters from the url beginning with 'utm_' | |
* Leaves anchors (#) and other query params alone, so | |
* example.com/?session=SESSIONID&utm_source=instagram#content | |
* would become |
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
// Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/ | |
/** | |
* Fetch and log a request | |
* @param {Request} request | |
*/ |