Skip to content

Instantly share code, notes, and snippets.

View asadulloh-pro's full-sized avatar
🎯
Focusing

Asadulloh Pro asadulloh-pro

🎯
Focusing
View GitHub Profile
@asadulloh-pro
asadulloh-pro / useAppSearchParams.ts
Last active June 20, 2025 13:50
next/router dan useSearchParams ni olib ishlatish biroz noqulaylik tug'diradi. Men qolbola hook yasab shu holatda ishlataman.
import { usePathname, useSearchParams } from 'next/navigation';
import { useRouter } from 'next/router';
import { useCallback } from 'react';
const useAppSearchParams = () => {
const searchParams = useSearchParams();
const pathname = usePathname();
const { replace } = useRouter();
const setSearchParams = useCallback(
@asadulloh-pro
asadulloh-pro / api.ts
Last active June 20, 2025 13:43
Hozirgi kunda menda yaxshi yechim bo'lib turgan "fetch" servisini ulashishni lozim ko'rdim.
export type HttpMethod =
| 'GET'
| 'POST'
| 'PUT'
| 'DELETE'
| 'PATCH'
| 'HEAD'
| 'OPTIONS';
export type RequestConfig = {