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
<div class="mt-24 w-96 p-4 mx-auto rounded-lg shadow-lg overflow-hidden relative after:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:h-16 after:bg-gradient-to-b after:from-transparent after:to-white"> | |
<h1 class="text-3xl mb-3 font-bold underline"> | |
Hello world! | |
</h1> | |
<p class="leading-snug"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</p> | |
</div> |
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 |