Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg%20%22Image%20title%22?q=fetch&page=86&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 13732 results for "fetch"(1710ms)

MiniAppStarterimage.tsx2 matches

@chrismeetworld•Updated 1 week ago
76 const fontPromises = fontsConfig.map(async (font) => {
77 const fontUrl = 'https://cdn.jsdelivr.net/npm/@tamagui/font-inter@1.108.3/otf/' + font.fontFile
78 const fontArrayBuf = await fetch(fontUrl).then((res) => res.arrayBuffer())
79 return { name: font.name, data: fontArrayBuf, weight: font.weight }
80 })
87 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
88 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`
89 return fetch(api).then((r) => r.text())
90}
91

MiniAppStarterHome.tsx1 match

@chrismeetworld•Updated 1 week ago
7
8import { Button, Input, Section } from "../components/ui.tsx";
9import { fetchUsersById } from "../util/neynar.ts";
10
11export function Home() {
41
42async function sendNotification(notificationDetails: any, payload: any) {
43 return await fetch(notificationDetails.url, {
44 method: "POST",
45 headers: { "Content-Type": "application/json" },

MiniAppStarterApp.tsx5 matches

@chrismeetworld•Updated 1 week ago
8import { FarcasterMiniApp } from "./components/FarcasterMiniApp.tsx";
9import { Button, Section } from "./components/ui.tsx";
10import { fetchNeynarGet } from "./util/neynar.ts";
11
12export function App() {
67
68function Database() {
69 const queryFn = () => fetch("/api/counter/get").then((r) => r.json());
70 const { data, refetch } = useQuery({ queryKey: ["counter"], queryFn });
71 return (
72 <Section className="flex flex-col items-start gap-3 m-5">
73 {/* <h2 className="font-semibold">Database Example</h2> */}
74 <div className="">Counter value: {data}</div>
75 <Button variant="outline" onClick={() => fetch("/api/counter/increment").then(refetch)}>
76 Increment
77 </Button>
82function Neynar() {
83 useEffect(() => {
84 fetchNeynarGet("user/by_username?username=moe").then(console.log).catch(console.error);
85 }, []);
86

crm_OBUO_FARMSindex.ts1 match

@eddie_walk•Updated 1 week ago
31});
32
33export default app.fetch; // This is the entry point for HTTP vals

crm_OBUO_FARMSfinancial.ts6 matches

@eddie_walk•Updated 1 week ago
65 });
66 } catch (error) {
67 console.error('Error fetching expenses:', error);
68 return c.json<ApiResponse<null>>({
69 success: false,
70 error: "Failed to fetch expenses"
71 }, 500);
72 }
96 });
97 } catch (error) {
98 console.error('Error fetching expense:', error);
99 return c.json<ApiResponse<null>>({
100 success: false,
101 error: "Failed to fetch expense"
102 }, 500);
103 }
220 });
221 } catch (error) {
222 console.error('Error fetching revenue:', error);
223 return c.json<ApiResponse<null>>({
224 success: false,
225 error: "Failed to fetch revenue"
226 }, 500);
227 }

crm_OBUO_FARMSOrderForm.tsx7 matches

@eddie_walk•Updated 1 week ago
33 const feedTypes = ['Fish Feed', 'Poultry Feed'] as const;
34
35 // Fetch products on component mount
36 useEffect(() => {
37 fetchProducts();
38 }, []);
39
43 }, [formData.productCategory, formData.fishType, formData.productForm, formData.poultryType, formData.eggType, formData.feedType]);
44
45 const fetchProducts = async () => {
46 try {
47 const response = await fetch('/api/products');
48 const result: ApiResponse<Product[]> = await response.json();
49 if (result.success && result.data) {
51 }
52 } catch (error) {
53 console.error('Failed to fetch products:', error);
54 }
55 };
114
115 try {
116 const response = await fetch('/api/orders', {
117 method: 'POST',
118 headers: {
142
143 // Refresh products to get updated stock
144 await fetchProducts();
145
146 // Clear success message after 3 seconds

crm_OBUO_FARMSInventoryManagement.tsx11 matches

@eddie_walk•Updated 1 week ago
18
19 useEffect(() => {
20 fetchProducts();
21 fetchStockMovements();
22 }, []);
23
24 const fetchProducts = async () => {
25 try {
26 const response = await fetch('/api/products');
27 const result: ApiResponse<Product[]> = await response.json();
28 if (result.success && result.data) {
30 }
31 } catch (error) {
32 console.error('Failed to fetch products:', error);
33 setError('Failed to load products');
34 }
35 };
36
37 const fetchStockMovements = async () => {
38 try {
39 const response = await fetch('/api/products/movements/all?limit=50');
40 const result: ApiResponse<StockMovement[]> = await response.json();
41 if (result.success && result.data) {
43 }
44 } catch (error) {
45 console.error('Failed to fetch stock movements:', error);
46 }
47 };
57
58 try {
59 const response = await fetch(`/api/products/${selectedProduct.id}/adjust-stock`, {
60 method: 'POST',
61 headers: {
71 setAdjustmentData({ quantity: 0, reason: '', movementType: 'IN' });
72 setSelectedProduct(null);
73 await fetchProducts();
74 await fetchStockMovements();
75 } else {
76 setError(result.error || 'Failed to adjust stock');

crm_OBUO_FARMSorders.ts4 matches

@eddie_walk•Updated 1 week ago
167 });
168 } catch (error) {
169 console.error('Error fetching orders:', error);
170 return c.json<ApiResponse<null>>({
171 success: false,
172 error: "Failed to fetch orders"
173 }, 500);
174 }
199 });
200 } catch (error) {
201 console.error('Error fetching order:', error);
202 return c.json<ApiResponse<null>>({
203 success: false,
204 error: "Failed to fetch order"
205 }, 500);
206 }

reactHonoStarterindex.ts2 matches

@mumokioko•Updated 1 week ago
21});
22
23// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;

FetchBasic2 file matches

@ther•Updated 2 days ago

GithubPRFetcher

@andybak•Updated 5 days ago