$_Code Scaffolder
sign insign up
$ scaffold init — v0.4.2

Snippets, but with
shape.

Build a library of reusable TSX blocks. Compose them into templates. Drop them into any file in seconds — locally, in the browser, or from VS Code.

open editorcreate accountno credit card · 51 community blocks
~/useFetch.tsx
tsx
1
// useFetch.tsx — typed data hook with abort + retry
2
 
3
import { useEffect, useRef, useState } from 'react';
4
import { cn } from '@/lib/utils';
5
 
6
type Status = 'idle' | 'loading' | 'ok' | 'error';
7
 
8
export function useFetch<T>(url: string) {
9
const [data, setData] = useState<T | null>(null);
10
const [status, setStatus] = useState<Status>('idle');
11
const ctrl = useRef<AbortController>();
12
 
13
useEffect(() => {
14
ctrl.current = new AbortController();
15
setStatus('loading');
16
fetch(url, { signal: ctrl.current.signal })
17
.then((r) => r.json() as Promise<T>)
18
.then((d) => { setData(d); setStatus('ok'); })
// 01

Build blocks

Define small, typed pieces of code with hoistable imports and props metadata.

// 02

Compose templates

Stack blocks into a starting point. Save under any name. Share with your team.

// 03

Insert anywhere

Use the in-browser editor today. VS Code extension on the roadmap.