Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@leather.io/query

Package Overview
Dependencies
Maintainers
3
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leather.io/query

Leather query

latest
Source
npmnpm
Version
2.47.0
Version published
Weekly downloads
262
-25.99%
Maintainers
3
Weekly downloads
 
Created
Source

@leather.io/queries

We use React Query to fetch APIs and to manage the cache of the responses.

Code practices:

  • Queries must only export query builders. Do not export React hooks
  • API calls must be kept separate
function fetchGroups(): Promise<Group[]> {
  return axios.get('groups').then((response) => response.data)
}

// ✅ Export query builder
export function createGroupsQuery() {
  return { queryKey: ['groups'], queryFn: fetchGroups };
}

// ❌ Do not export a pre-made query
export function useGroups() {
  return useQuery({ queryKey: ['groups'], queryFn: fetchGroups })
}

Reference

  • https://tkdodo.eu/blog/practical-react-query
  • https://tkdodo.eu/blog/effective-react-query-keys#use-query-key-factories

Keywords

leather

FAQs

Package last updated on 13 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts