apps/mobile/package.json
"expo install": "npx expo install"bash; from root
npm run "expo install" --workspace=mobile -- zustand| "use client"; | |
| import { usePathname } from "next/navigation"; | |
| import { useEffect, useLayoutEffect, useRef } from "react"; | |
| const KEY_PREFIX = "scroll-"; | |
| const useIsoLayoutEffect = | |
| typeof window !== "undefined" ? useLayoutEffect : useEffect; |
| (() => { | |
| if (window.__acceptStalled) { | |
| console.warn("[stall] already installed"); | |
| return; | |
| } | |
| const ACCEPT_RE = /authorize\.net\/v1\/Accept\.js/i; | |
| const origAdd = EventTarget.prototype.addEventListener; | |
| const stalled = []; |
| git_diff_summary() { | |
| # Check if the current directory is a git repository | |
| git rev-parse --is-inside-work-tree > /dev/null 2>&1 | |
| if [ $? -ne 0 ]; then | |
| echo "Not a git repository." | |
| return 1 # Exit the function if not in a git repository | |
| fi | |
| echo "Staged Changes:" | |
| local last_line_staged=$(git diff --staged --stat | tail -n 1) |
apps/mobile/package.json
"expo install": "npx expo install"bash; from root
npm run "expo install" --workspace=mobile -- zustand| import { renderHook } from "@testing-library/react"; | |
| import useInterval from "./useInterval"; | |
| describe("useInterval", () => { | |
| beforeEach(() => { | |
| jest.useFakeTimers(); | |
| }); | |
| afterEach(() => { | |
| jest.clearAllTimers(); |
| import { useEffect, useMemo, useRef } from "react"; | |
| type UseIntervalTypes = { | |
| callback: () => void; | |
| delay: number; | |
| }; | |
| /** | |
| * React lifecycle-aware implementation of setInterval. | |
| * This allows for a quick implementation of setInterval in React without having to worry about cleanup. |
| mkdirc () | |
| { | |
| mkdir -p -- "$1" && | |
| cd -P -- "$1" | |
| } |