{"id":13566946,"url":"https://github.com/hazae41/glacier","last_synced_at":"2025-04-04T18:02:18.082Z","repository":{"id":57699883,"uuid":"502095496","full_name":"hazae41/glacier","owner":"hazae41","description":"Keep your data fresh","archived":false,"fork":false,"pushed_at":"2024-12-10T21:57:38.000Z","size":2198,"stargazers_count":126,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T17:02:04.078Z","etag":null,"topics":["ethersjs","fetch","garbage-collection","graphql","indexeddb","localstorage","nextjs","normalization","react","react-hooks","react-query","react-suspense","redux","rest","server-side-rendering","suspense","swr","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hazae41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["hazae41"],"patreon":"hazae41"}},"created_at":"2022-06-10T15:37:42.000Z","updated_at":"2024-12-10T21:57:42.000Z","dependencies_parsed_at":"2023-09-24T17:57:21.477Z","dependency_job_id":"f06f7907-fa94-4035-bafc-1841e31befe5","html_url":"https://github.com/hazae41/glacier","commit_stats":{"total_commits":943,"total_committers":4,"mean_commits":235.75,"dds":"0.24284199363732772","last_synced_commit":"0bdeec15eeb57e6b40b202c90b7f08c5c916eb6d"},"previous_names":["hazae41/xswr"],"tags_count":271,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fglacier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fglacier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fglacier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fglacier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hazae41","download_url":"https://codeload.github.com/hazae41/glacier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226210,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethersjs","fetch","garbage-collection","graphql","indexeddb","localstorage","nextjs","normalization","react","react-hooks","react-query","react-suspense","redux","rest","server-side-rendering","suspense","swr","typescript"],"created_at":"2024-08-01T13:02:20.085Z","updated_at":"2025-04-04T18:02:18.057Z","avatar_url":"https://github.com/hazae41.png","language":"TypeScript","funding_links":["https://github.com/sponsors/hazae41","https://patreon.com/hazae41"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/4405263/269623949-10c3fb8c-c492-4284-b39a-e51132fb27c4.png\" /\u003e\n\u003c/div\u003e\n\n```bash\nnpm i @hazae41/glacier\n```\n\n[**Node Package 📦**](https://www.npmjs.com/package/@hazae41/glacier) • [**Read the docs 📚**](https://github.com/hazae41/glacier/blob/master/docs) • [**Next.js Example 🪣**](https://codesandbox.io/p/github/hazae41/glacier-example-next) • [**Expo Example 🪣**](https://snack.expo.dev/@git/github.com/hazae41/xswr-example-expo) • [**Comparison with other libs 🌐**](https://github.com/hazae41/glacier/blob/master/docs/comparison.md)\n\n## Philosophy 🧠\n\nGlacier uses two new approaches compared to other data fetching libraries like swr or react-query:\n1) Encapsulating key+fetcher+params in a single abstraction called schema.\n2) Composing features with very simple hooks instead of having bloated configuration and unexpected behaviors.\n\n```tsx\nfunction useAutoFetchMixture(query: Query) {\n  useFetch(query) // Fetch on mount and url change\n  useVisible(query) // Fetch when the page is focused\n  useOnline(query) // Fetch when the browser is online\n}\n\nfunction useHelloWithAutoFetch() {\n  const query = useQuery(createHelloQuery, [])\n  useAutoFetchMixture(query)\n  return query\n}\n\nfunction MyApp() {\n  const { data, error } = useHelloWithAutoFetch()\n\n  if (error != null)\n    return \u003cMyError error={error} /\u003e\n  if (data == null)\n    return \u003cMyLoading /\u003e\n  return \u003cMyPage data={data} /\u003e\n}\n```\n\n## Features 🔥\n\n- 100% TypeScript and ESM\n- No external dependency\n- Composition-based hooks\n- Rust-like patterns\n- Transport agnostic (REST, GraphQL, WebSocket)\n- Storage agnostic (IndexedDB, localStorage)\n- Works in a Service Worker or in a serverless function\n- Per-query, encrypted, garbage-collected, persistent storage\n- Store normalization and indexes\n- Concurrent and multi-step optimistic states\n- Request deduplication, cooldown, timeout, cancellation, expiration, and retrying\n- Automatic refetching based on various signals\n- Page-based and cursor-based pagination\n- SSR \u0026 ISR support\n- React Suspense support\n- React Native support","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Fglacier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazae41%2Fglacier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Fglacier/lists"}