Skip to content

Instantly share code, notes, and snippets.

View rendro's full-sized avatar
🤘
🤨

Robert rendro

🤘
🤨
View GitHub Profile
type TAction<T: $Subtype<string>, P> = {
type: T,
payload: P,
};
const ActionTypes = {
STRING: 'STRING',
NUMBER: 'NUMBER',
LOGIN: 'LOGIN',
LOGIN_PAGE: 'LOGIN_PAGE',
@rendro
rendro / ViewportObserver.react.tsx
Last active March 25, 2025 00:03
Viewport Observer React Component
import { Slot } from "@radix-ui/react-slot";
type Props = React.ComponentPropsWithoutRef<"div"> & {
asChild?: boolean;
options?: IntersectionObserverInit;
onAppear?: () => void;
onDisappear?: () => void;
};
export function ViewportObserver({