This file contains hidden or 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
# override yarn command to always use doppler before executing | |
yarn() { | |
if command -v doppler &> /dev/null | |
then | |
{ | |
printf "using yarn with doppler \n" | |
command doppler run --preserve-env -- yarn "$@" | |
} || { | |
local blue=$(tput setaf 4) | |
local normal=$(tput sgr0) |
This file contains hidden or 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 { useEffect, useRef } from "react"; | |
type OnMountCB = () => void; | |
type OnMountDeps = unknown[]; | |
export const useEffectAfterMount = (cb: OnMountCB, deps?: OnMountDeps) => { | |
const componentJustMounted = useRef(true); | |
useEffect(() => { | |
if (!componentJustMounted.current) { | |
return cb(); |