[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F2F9C2KGFP406C24Z6BF75":3,"skill-same:01M7F2F9C2KGFP406C24Z6BF75":391},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7F2F9C2KGFP406C24Z6BF75","networking-and-server-state",null,"Builds TanStack Query server state over an ApiClient - validated responses, keys, retries, optimistic writes, offline. Use when calling an API, adding a query or mutation, or data is stale. Not for local data (persistence-and-migrations).","zakariaf\u002FReactNative-Skills","zakariaf","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2259803?v=4","01M7DEF0YMPS6Y6RQ4WGA0JH9R","Zakaria Fatahi","01M7F1VKYEK96M7SYJE1EPGD0A",13,"MIT","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: networking-and-server-state\ndescription: Builds TanStack Query server state over an ApiClient - validated responses, keys, retries, optimistic writes, offline. Use when calling an API, adding a query or mutation, or data is stale. Not for local data (persistence-and-migrations).\n---\n\n# Networking and server state\n\nThe app talks to its server through one typed `ApiClient` port whose only transport calls `fetch` with\na deadline, checks every response against a valibot schema and never rejects; server data lives in\nTanStack Query's cache, defined once per resource in `src\u002Fapi\u002F`, read in model hooks, retried only when\na retry can help, kept fresh by React Native focus and connectivity, and honest about offline. A\nzero-dependency checker proves it.\n\n## Rules that must hold\n\n1. **One network seam.** `fetch`, `XMLHttpRequest`, `WebSocket`, `EventSource` and `sendBeacon` appear\n   only in `src\u002Fapi\u002F`, and `fetch` in exactly one file, `src\u002Fapi\u002Ffetch-api-client.ts`; no HTTP client\n   package (axios, ky, `expo\u002Ffetch` imports). `src\u002Fapi\u002Fapi-client.ts` exports `ApiClient`,\n   `src\u002Fapi\u002Fapi-failure.ts` exports `ApiFailure`. Why: one place owns deadlines, validation, auth\n   headers and the privacy inventory, and lint can ban the rest.\n2. **The ApiClient never rejects.** `request()` returns `Result\u003CT, ApiFailure>`: offline, timeouts,\n   cancellation, HTTP errors and invalid bodies are typed values; every awaited `fetch` and body read\n   sits inside one `try\u002Fcatch`; a failure is classified by who aborted (the caller's signal, the\n   client's own deadline) and by status, never by error text. Why: expo\u002Ffetch, React Native's fetch and\n   Node's fetch word every error differently, and a rejection that escapes crashes a release handler.\n3. **Every attempt has a deadline and honours the caller's signal.** The transport aborts each attempt\n   after `timeoutMs` (default 15 s, body included), links TanStack's `signal`, and every `queryFn` passes\n   `signal` to the request. Why: Android's OkHttp client has no timeouts, so a stalled request never\n   ends; TanStack cancels an abandoned fetch only when the `queryFn` read the signal.\n4. **Every response passes its schema, tolerantly.** Each request names a valibot `schema`; the\n   transport `safeParse`s every 2xx body and records an invalid one once (method, path, issue paths,\n   never the body); no `.json() as T`, no `.json()` or `JSON.parse` outside the transport; response\n   schemas use `v.object` (never `v.strictObject`) and wrap closed sets in `v.fallback`. Why: a cast\n   checks nothing, and a server that adds a field or an enum value must not break installed apps.\n5. **The base URL comes from config, over HTTPS.** `EXPO_PUBLIC_API_URL` per EAS environment, read by\n   the app's `src\u002Fconfig` reader and checked by `parseApiBaseUrl` (https outside development); no URL\n   literal in `src\u002Fapi\u002F`, no `baseUrl: '\u003Cliteral>'`, no `NSAllowsArbitraryLoads` or\n   `usesCleartextTraffic` switch. Why: each variant talks to its own server, and release builds block\n   cleartext on iOS (ATS) and Android 9+, so a global switch ships to the store.\n6. **Queries and mutations are defined once, next to their keys.** Each resource has\n   `src\u002Fapi\u002F\u003Cresource>\u002F\u003Cresource>-keys.ts` (hierarchical, `all` root, `as const`),\n   `-schemas.ts`, `-queries.ts` (`queryOptions`\u002F`infiniteQueryOptions`) and `-mutations.ts`\n   (`mutationOptions`); no inline key arrays, no `queryFn`\u002F`mutationFn` or `.request({ method, path })`\n   elsewhere. Why: one typo in an inline key misses an invalidation, and `queryOptions` ties the key to\n   the data type for `getQueryData`\u002F`setQueryData` without casts.\n7. **Server state is read in the feature's model hook.** TanStack hooks appear only in\n   `src\u002Ffeatures\u002F**\u002Fuse-*.ts(x)`, `src\u002Fhooks\u002F` and `src\u002Fapi\u002F`; views get plain props; query data is\n   never copied into a store, `useState` or an effect (the house ESLint config catches the effect copy,\n   not this checker). Why: two copies drift on every refetch, and the view stays testable without a\n   client.\n8. **One QueryClient per app run, with a failure-aware retry policy.** `createQueryClient` in\n   `src\u002Fapi\u002F` is the only `new QueryClient` in app code, called once from AppRoot's `startApp` (a\n   `useState` initializer, after the data layer and the error sink; never at module level or in a render body); queries retry only retryable failures\n   (no connection, deadline, 408, 429 after `Retry-After`, 5xx), at most 3 times; mutations retry only\n   with an `idempotencyKey`; never `retry: true`\u002F`Infinity`\u002Fmore than 3. Why: TanStack's default spins\n   about seven seconds on a 404, and a retried POST without a key can create two tasks.\n9. **Focus and online come from React Native, through one port.** `connectQueryManagers` feeds\n   `focusManager` from AppState (`active` only) and `onlineManager` from the `ConnectivityPort`, whose\n   one expo-network adapter (the only importer of expo-network or NetInfo) is created by the\n   composition root; `QueryProvider` mounts the client and the wiring in the root providers. Online\n   means `isConnected` alone; Android's `isInternetReachable` is only the `reachability()` hint for\n   banners, ads and purchases. Why: React Native has no window events, so without it nothing pauses\n   offline, resumes on reconnect or refetches on return; and Android marks some working networks\n   unvalidated for good, where pausing on reachability would keep every request waiting forever.\n10. **Every write says what it does to the cache; optimistic writes can roll back.** A mutation\n    invalidates or sets the keys it changed in `onSuccess`\u002F`onSettled`, or carries\n    `\u002F\u002F no-cache-effect: \u003Cwhy>`; an `onMutate` that writes the cache cancels in-flight queries first,\n    snapshots, restores the snapshot in `onError` and invalidates in `onSettled`. Why: otherwise lists\n    show old data, or a refused write stays on screen as if it happened.\n11. **Offline pauses, it does not fail.** Keep `networkMode: 'online'` (a local-only query says\n    `\u002F\u002F network-mode-always: \u003Cwhy>`); show cached data with an offline notice, never an error in its\n    place; a persisted cache sets `buster` and `maxAge`; writes that must survive a kill go to the\n    outbox (persistence-and-migrations) and sync with their id as `idempotencyKey`. Why: paused work\n    resumes by itself, and a restored cache in an old shape would skip every schema.\n12. **Tests use the seams, never the network.** The transport gets a fake `FetchLike`; everything above\n    it gets `createFakeApiClient()` from `test\u002Fapi\u002F`, which checks canned bodies through the request's\n    schema and rejects unscripted requests; no test replaces the global `fetch` or mocks `expo\u002Ffetch`.\n    Why: a replaced global leaks across tests and proves a seam the app never uses.\n13. **The UI shows failures by kind.** Model hooks read `apiFailureOf(error)` and map each `kind`\n    through one `Record\u003CApiFailureKind, MessageKey | null>` table; never `error.message`; `cancelled` is\n    never shown and expected failures are never recorded. Why: a new kind is then a compile error until\n    it has a message in every locale.\n\n## Workflow\n\n1. Decide whether the app has a server. An app with no network at all follows the `offline-only`\n   profile of privacy-and-store-declarations instead (the checker prints NOT APPLICABLE there). Read\n   [references\u002Fapi-client-and-transport.md](references\u002Fapi-client-and-transport.md).\n2. Install (stack table, verified 2026-10-03): `npx expo install expo-network` and\n   `npm install -E @tanstack\u002Freact-query@5.104.0 valibot@1.5.0`.\n3. Copy `templates\u002Fsrc\u002Fapi\u002F` (with `tasks\u002F`), `templates\u002Fsrc\u002Fconfig\u002Fapi-base-url.ts` and its test,\n   `templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002F`, and `templates\u002Ftest\u002Fapi\u002F`. The synced files\n   (`src\u002Fcore\u002Fresult.ts`, `src\u002Fconfig\u002Fapp-variant.ts`, `src\u002Fservices\u002Ferror-log\u002F*`,\n   `test\u002Fflush-microtasks.ts`) come from their owner skills: copy them only if the app lacks them.\n4. Environment: declare `EXPO_PUBLIC_API_URL` in `src\u002Fenv.d.ts` and read it in the app's\n   `src\u002Fconfig\u002Fenvironment.ts` as `examples\u002Fenvironment.ts` shows. Setting the value in each EAS\n   environment (`eas env:set --name EXPO_PUBLIC_API_URL --value \u003Chttps-url> --environment \u003Cenv>\n   --visibility plaintext`) is the developer's step: stop and ask before running it.\n5. Composition root: add `api` and `connectivity` to `Services`, `createDeviceServices` and\n   `createTestServices` as in `examples\u002Fcomposition-root\u002F`.\n6. Startup: read the checked environment in the root layout's `decideStartup`\n   (`examples\u002Froot-layout.tsx`), create the client in AppRoot's `startApp` right after the error sink,\n   and render `QueryProvider` right after `AppDataProvider` inside `AppProviders`\n   (`examples\u002Fapp-root.tsx`, `examples\u002Fapp-providers.tsx`; app-startup-and-bootstrap owns the order).\n7. Each resource: replace the Tasks keys, schemas, queries and mutations with the app's own, reading\n   [references\u002Fschemas-and-failures.md](references\u002Fschemas-and-failures.md),\n   [references\u002Fqueries-and-cache.md](references\u002Fqueries-and-cache.md) and\n   [references\u002Fmutations-and-optimistic-updates.md](references\u002Fmutations-and-optimistic-updates.md).\n   Paged lists: `examples\u002Ftask-pages.ts`.\n8. Model hooks: read server state as `examples\u002Fuse-tasks-model.ts` does, turn query state into a view\n   state (`examples\u002Ftask-list-state.ts`) and failures into message keys\n   (`examples\u002Fapi-failure-message.ts`; add the keys to every catalog with i18n-strings-and-catalogs).\n9. Offline needs (a persisted cache, an outbox, sign-out clearing): read\n   [references\u002Fonline-focus-and-offline.md](references\u002Fonline-focus-and-offline.md).\n10. Tests: follow [references\u002Ftesting-server-state.md](references\u002Ftesting-server-state.md); run\n    `npx jest src\u002Fapi src\u002Fconfig src\u002Fservices\u002Fconnectivity test\u002Fapi --ci` and `npm run typecheck`.\n11. Run `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-server-state.mjs .` from the repo root; fix each `FAIL`\n    line (rule ids in [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md)) and rerun until\n    `RESULT: PASS`.\n\n## Definition of done\n\n- [ ] `fetch` appears only in `src\u002Fapi\u002Ffetch-api-client.ts`; no other network API outside `src\u002Fapi\u002F`; no HTTP client package.\n- [ ] `request()` never rejects: fetch and the body read sit in one `try\u002Fcatch`; each attempt has a deadline linked to the caller's signal; every `queryFn` passes `signal`.\n- [ ] Every request names a schema; invalid bodies are recorded once without the data; response schemas are tolerant (`v.object`, `v.fallback` around closed sets).\n- [ ] The base URL comes from `parseApiBaseUrl(process.env.EXPO_PUBLIC_API_URL, variant)` in `src\u002Fconfig`; each EAS environment has its HTTPS value (or the report says the developer still has to set it); no cleartext switch.\n- [ ] Each resource has keys, schemas, `queryOptions` and `mutationOptions` factories in `src\u002Fapi\u002F\u003Cresource>\u002F`, each with its test against the fake ApiClient.\n- [ ] TanStack hooks only in model hooks; one client from `createQueryClient` in AppRoot's `startApp` (a `useState` initializer); `QueryProvider` mounted right after `AppDataProvider`.\n- [ ] Every mutation has a cache effect (or a reasoned `no-cache-effect` marker); optimistic ones cancel, snapshot, roll back and invalidate; retrying writes send an idempotency key.\n- [ ] `npx jest src\u002Fapi src\u002Fconfig src\u002Fservices\u002Fconnectivity test\u002Fapi --ci` passes and `npm run typecheck` is clean; the device checks of testing-server-state.md section 9 ran, or the report says they are owed.\n- [ ] `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-server-state.mjs .` prints `RESULT: PASS`. Expected only before the root layout exists: `SKIP src\u002Fapp\u002F_layout.tsx [managers-wired] not yet created (navigation-and-routing creates it)`. An app without a server prints `NOT APPLICABLE: no app code imports @tanstack\u002Freact-query or calls the network, and there is no src\u002Fapi\u002F`.\n\n## Anti-patterns\n\n- **`fetch` in a hook or a screen \"just for this one call\".** No deadline, no schema, no auth header,\n  no fake in tests; add a query factory in `src\u002Fapi\u002F\u003Cresource>\u002F`.\n- **`await response.json() as Task[]`.** Nothing is checked; the first server change crashes a screen\n  far from the cause. Pass a schema.\n- **Deciding offline from `error.message === 'Network request failed'`.** That text exists only in\n  React Native's fetch; expo\u002Ffetch says `fetch failed: ...`. Ask the signal, the deadline flag and the\n  ConnectivityPort.\n- **`new QueryClient()` at module level or in the layout body.** It outlives logout and is shared by\n  every test, or it is a new empty cache on every render. Create it in a `useState` initializer.\n- **`retry: 3` on a mutation, or keeping TanStack's default retry for queries.** Duplicate writes;\n  seven seconds of spinner before a 404 shows.\n- **`queryKey: ['task', id]` typed inline.** One letter off from `['tasks']`, and the invalidation\n  misses it. Use the key factory.\n- **Copying `query.data` into a Zustand store or `useState` \"to edit it\".** Two copies drift; edit a\n  draft keyed by id, and write through a mutation.\n- **NetInfo or `expo-network` subscribed in a screen or in the onlineManager wiring.** A second native\n  subscription, and on iOS the module's single monitor can be cancelled for good. Read the\n  ConnectivityPort.\n- **Feeding onlineManager from `isInternetReachable`.** On an Android network that never validates\n  (a firewall blocking the probe, \"use this network anyway\") every query stays paused forever while\n  requests would succeed. Feed it `isOnline()`; show `reachability()` in a banner.\n- **An optimistic update without `cancelQueries` or a rollback.** The value flickers back, or a refused\n  write stays on screen.\n- **`usesCleartextTraffic: true` to make a preview build reach `http:\u002F\u002F10.0.2.2`.** It ships to the\n  store; give the API an HTTPS endpoint per environment.\n- **`jest.spyOn(globalThis, 'fetch')`.** Leaks into other tests; pass a fake `FetchLike` or the fake\n  ApiClient.\n- **Persisting the query cache without `buster` and `maxAge`.** Restored data in an old shape skips\n  every schema, and data of any age reappears.\n\n## Files in this skill\n\n| File | What it is | Read\u002Frun when |\n|---|---|---|\n| [references\u002Fapi-client-and-transport.md](references\u002Fapi-client-and-transport.md) | The port, what `fetch` is on iOS and Android in SDK 57, deadlines, cancellation, failure classification, URLs and headers, idempotency, base URL and cleartext per platform, HTTP cache and cookies, verified facts | Workflow steps 1-4 |\n| [references\u002Fschemas-and-failures.md](references\u002Fschemas-and-failures.md) | One schema per response, tolerant reading, transforms, recording invalid responses, the failure family and who handles each kind, `unwrap`\u002F`apiFailureOf` | Workflow steps 7-8 |\n| [references\u002Fqueries-and-cache.md](references\u002Fqueries-and-cache.md) | TanStack defaults, `queryOptions`, key factories, the retry policy, freshness, stacked screens and `subscribed`, status vs fetchStatus, dependent, paged and prefetched queries | Workflow steps 7-8 |\n| [references\u002Fmutations-and-optimistic-updates.md](references\u002Fmutations-and-optimistic-updates.md) | `mutationOptions`, choosing a cache effect, the four optimistic steps, UI-only optimism, concurrent writes, idempotency, conflicts, calling mutations, 5.104 callback signatures | Workflow step 7 |\n| [references\u002Fonline-focus-and-offline.md](references\u002Fonline-focus-and-offline.md) | Why React Native needs manager wiring, the ConnectivityPort on iOS and Android, AppState focus, paused queries and mutations, offline UI, the persisted cache, the outbox split, sign-out | Workflow steps 6 and 9 |\n| [references\u002Ftesting-server-state.md](references\u002Ftesting-server-state.md) | The seam per layer, transport, factory, hook, manager and optimistic tests, timing without fake timers, device checks | Workflow step 10 |\n| [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md) | Every rule id, its scope, the two markers, layout keys, monorepo use, known limits | Workflow step 11, on a FAIL |\n| `templates\u002Fsrc\u002Fapi\u002F` | `api-client.ts`, `api-failure.ts`, `api-error.ts`, `build-url.ts`, `to-api-failure.ts`, `fetch-api-client.ts`, `api-query-options.ts`, `create-query-client.ts`, `query-managers.ts`, `query-provider.tsx`, and their tests; `tasks\u002F` holds the Tasks resource (keys, schemas, queries, mutations with an optimistic toggle and an idempotent create, with tests) | Workflow steps 3 and 7 |\n| `templates\u002Fsrc\u002Fconfig\u002F` | `api-base-url.ts` (`parseApiBaseUrl`, the checked base URL per variant) and its test; `app-variant.ts` and its test are synced from app-variants-and-environment (do not edit here) | Workflow steps 3-4 |\n| `templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002F` | The `ConnectivityPort` (`isOnline` plus the `reachability` hint), its expo-network adapter, the shared `reachability-hub.ts` fan-out and the fake, with tests (this skill owns them; synced from the library, do not edit here) | Workflow step 3 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-log\u002F` | The error log port and fake with its test, synced from architecture-and-boundaries (do not edit here) | Workflow step 3, only if the app lacks them |\n| `templates\u002Fsrc\u002Fcore\u002F` | `result.ts` and its test, synced from error-handling-typed-results (do not edit here) | Workflow step 3, only if the app lacks them |\n| `templates\u002Ftest\u002F` | `api\u002Ffake-api-client.ts`, the scripted ApiClient for tests, and its test; `flush-microtasks.ts`, synced from unit-and-component-tests (do not edit here) | Workflow steps 3 and 10 |\n| `examples\u002Fenvironment.ts` | The app's public-environment reader with the API base URL | Workflow step 4 |\n| `examples\u002Fcomposition-root\u002F` | `Services`, `createDeviceServices`, `createTestServices` with the `api` and `connectivity` ports, and a test | Workflow step 5 |\n| `examples\u002Froot-layout.tsx` | The canonical root layout reading the checked environment in `decideStartup` | Workflow step 6 |\n| `examples\u002Fapp-root.tsx` | The canonical AppRoot creating the QueryClient once in `startApp` | Workflow step 6 |\n| `examples\u002Fapp-providers.tsx` | AppRoot's outer providers with `QueryProvider` right after `AppDataProvider` | Workflow step 6 |\n| `examples\u002Ftask-pages.ts` | A paged list with `infiniteQueryOptions` and a cursor | Workflow step 7 |\n| `examples\u002Fuse-tasks-model.ts` | A model hook over server state (`subscribed: isFocused`, an optimistic toggle) | Workflow step 8 |\n| `examples\u002Fuse-tasks-model.test.tsx` | Testing that hook in a route with the fake ApiClient, offline included | Workflow steps 8 and 10 |\n| `examples\u002Ftask-list-state.ts` | TanStack's status and fetchStatus turned into one view state | Workflow step 8 |\n| `examples\u002Fapi-failure-message.ts` | The message table of the ApiFailure family, with the catalog strings | Workflow step 8 |\n| `scripts\u002Fcheck-server-state.mjs` | The checker (21 rules; options `--src-dir`, `--api-dir`, `--json`) | Workflow step 11, and at the end |\n| `scripts\u002Flib\u002F` | The checker's rule sets and source model, and the synced `source-scan.mjs` (do not edit that one here) | Never by hand |\n| `scripts\u002Fcheck-lib.mjs` | Shared script helper, synced from the library (do not edit here) | Never by hand |\n| `scripts\u002Fselftest.mjs` | Proves the checker passes the templates and examples and catches every planted bug | After changing the checker, a template or an example |\n| `assets\u002Fshared.json` | Declares the shared files this skill copies in | When adding a shared file |\n| `tests\u002F` | The overlay base app (with planted findings in installed-skill folders that must stay silent) and one fixture per rule, plus pass and error cases | When adding a checker rule |\n\n## Related skills\n\n- `error-handling-typed-results` - the Result type, failure families, the error net; the ApiClient is one of its boundaries.\n- `architecture-and-boundaries` - ports, adapters and the composition root the ApiClient and ConnectivityPort join.\n- `app-variants-and-environment` - `EXPO_PUBLIC_*` readers and EAS environments.\n- `state-management-zustand` - client state; no server data in stores (its `server-state-in-store` check).\n- `persistence-and-migrations` - local tables, the outbox and the kv-store adapter under a persisted cache.\n- `auth-and-secure-storage` - tokens, the `headers()` hook and sign-out.\n- `async-safety` - effects, listeners and cancellation outside TanStack Query.\n- `ui-states-and-feedback` - loading, offline and error states on screen.\n- `forms-and-input` - server validation codes mapped to fields.\n- `unit-and-component-tests` - the test app, render helpers and test forms.\n- `privacy-and-store-declarations` - the network inventory and the `offline-only` profile.\n- `admob-ads-and-consent`, `in-app-purchases` - other consumers of the ConnectivityPort.\n- `background-tasks` - syncing the outbox while the app is closed.\n- Expo's official `expo-data-fetching` skill - the Expo fetch API reference.\n","# Networking and server state\n\nThe app talks to its server through one typed `ApiClient` port whose only transport calls `fetch` with\na deadline, checks every response against a valibot schema and never rejects; server data lives in\nTanStack Query's cache, defined once per resource in `src\u002Fapi\u002F`, read in model hooks, retried only when\na retry can help, kept fresh by React Native focus and connectivity, and honest about offline. A\nzero-dependency checker proves it.\n\n## Rules that must hold\n\n1. **One network seam.** `fetch`, `XMLHttpRequest`, `WebSocket`, `EventSource` and `sendBeacon` appear\n   only in `src\u002Fapi\u002F`, and `fetch` in exactly one file, `src\u002Fapi\u002Ffetch-api-client.ts`; no HTTP client\n   package (axios, ky, `expo\u002Ffetch` imports). `src\u002Fapi\u002Fapi-client.ts` exports `ApiClient`,\n   `src\u002Fapi\u002Fapi-failure.ts` exports `ApiFailure`. Why: one place owns deadlines, validation, auth\n   headers and the privacy inventory, and lint can ban the rest.\n2. **The ApiClient never rejects.** `request()` returns `Result\u003CT, ApiFailure>`: offline, timeouts,\n   cancellation, HTTP errors and invalid bodies are typed values; every awaited `fetch` and body read\n   sits inside one `try\u002Fcatch`; a failure is classified by who aborted (the caller's signal, the\n   client's own deadline) and by status, never by error text. Why: expo\u002Ffetch, React Native's fetch and\n   Node's fetch word every error differently, and a rejection that escapes crashes a release handler.\n3. **Every attempt has a deadline and honours the caller's signal.** The transport aborts each attempt\n   after `timeoutMs` (default 15 s, body included), links TanStack's `signal`, and every `queryFn` passes\n   `signal` to the request. Why: Android's OkHttp client has no timeouts, so a stalled request never\n   ends; TanStack cancels an abandoned fetch only when the `queryFn` read the signal.\n4. **Every response passes its schema, tolerantly.** Each request names a valibot `schema`; the\n   transport `safeParse`s every 2xx body and records an invalid one once (method, path, issue paths,\n   never the body); no `.json() as T`, no `.json()` or `JSON.parse` outside the transport; response\n   schemas use `v.object` (never `v.strictObject`) and wrap closed sets in `v.fallback`. Why: a cast\n   checks nothing, and a server that adds a field or an enum value must not break installed apps.\n5. **The base URL comes from config, over HTTPS.** `EXPO_PUBLIC_API_URL` per EAS environment, read by\n   the app's `src\u002Fconfig` reader and checked by `parseApiBaseUrl` (https outside development); no URL\n   literal in `src\u002Fapi\u002F`, no `baseUrl: '\u003Cliteral>'`, no `NSAllowsArbitraryLoads` or\n   `usesCleartextTraffic` switch. Why: each variant talks to its own server, and release builds block\n   cleartext on iOS (ATS) and Android 9+, so a global switch ships to the store.\n6. **Queries and mutations are defined once, next to their keys.** Each resource has\n   `src\u002Fapi\u002F\u003Cresource>\u002F\u003Cresource>-keys.ts` (hierarchical, `all` root, `as const`),\n   `-schemas.ts`, `-queries.ts` (`queryOptions`\u002F`infiniteQueryOptions`) and `-mutations.ts`\n   (`mutationOptions`); no inline key arrays, no `queryFn`\u002F`mutationFn` or `.request({ method, path })`\n   elsewhere. Why: one typo in an inline key misses an invalidation, and `queryOptions` ties the key to\n   the data type for `getQueryData`\u002F`setQueryData` without casts.\n7. **Server state is read in the feature's model hook.** TanStack hooks appear only in\n   `src\u002Ffeatures\u002F**\u002Fuse-*.ts(x)`, `src\u002Fhooks\u002F` and `src\u002Fapi\u002F`; views get plain props; query data is\n   never copied into a store, `useState` or an effect (the house ESLint config catches the effect copy,\n   not this checker). Why: two copies drift on every refetch, and the view stays testable without a\n   client.\n8. **One QueryClient per app run, with a failure-aware retry policy.** `createQueryClient` in\n   `src\u002Fapi\u002F` is the only `new QueryClient` in app code, called once from AppRoot's `startApp` (a\n   `useState` initializer, after the data layer and the error sink; never at module level or in a render body); queries retry only retryable failures\n   (no connection, deadline, 408, 429 after `Retry-After`, 5xx), at most 3 times; mutations retry only\n   with an `idempotencyKey`; never `retry: true`\u002F`Infinity`\u002Fmore than 3. Why: TanStack's default spins\n   about seven seconds on a 404, and a retried POST without a key can create two tasks.\n9. **Focus and online come from React Native, through one port.** `connectQueryManagers` feeds\n   `focusManager` from AppState (`active` only) and `onlineManager` from the `ConnectivityPort`, whose\n   one expo-network adapter (the only importer of expo-network or NetInfo) is created by the\n   composition root; `QueryProvider` mounts the client and the wiring in the root providers. Online\n   means `isConnected` alone; Android's `isInternetReachable` is only the `reachability()` hint for\n   banners, ads and purchases. Why: React Native has no window events, so without it nothing pauses\n   offline, resumes on reconnect or refetches on return; and Android marks some working networks\n   unvalidated for good, where pausing on reachability would keep every request waiting forever.\n10. **Every write says what it does to the cache; optimistic writes can roll back.** A mutation\n    invalidates or sets the keys it changed in `onSuccess`\u002F`onSettled`, or carries\n    `\u002F\u002F no-cache-effect: \u003Cwhy>`; an `onMutate` that writes the cache cancels in-flight queries first,\n    snapshots, restores the snapshot in `onError` and invalidates in `onSettled`. Why: otherwise lists\n    show old data, or a refused write stays on screen as if it happened.\n11. **Offline pauses, it does not fail.** Keep `networkMode: 'online'` (a local-only query says\n    `\u002F\u002F network-mode-always: \u003Cwhy>`); show cached data with an offline notice, never an error in its\n    place; a persisted cache sets `buster` and `maxAge`; writes that must survive a kill go to the\n    outbox (persistence-and-migrations) and sync with their id as `idempotencyKey`. Why: paused work\n    resumes by itself, and a restored cache in an old shape would skip every schema.\n12. **Tests use the seams, never the network.** The transport gets a fake `FetchLike`; everything above\n    it gets `createFakeApiClient()` from `test\u002Fapi\u002F`, which checks canned bodies through the request's\n    schema and rejects unscripted requests; no test replaces the global `fetch` or mocks `expo\u002Ffetch`.\n    Why: a replaced global leaks across tests and proves a seam the app never uses.\n13. **The UI shows failures by kind.** Model hooks read `apiFailureOf(error)` and map each `kind`\n    through one `Record\u003CApiFailureKind, MessageKey | null>` table; never `error.message`; `cancelled` is\n    never shown and expected failures are never recorded. Why: a new kind is then a compile error until\n    it has a message in every locale.\n\n## Workflow\n\n1. Decide whether the app has a server. An app with no network at all follows the `offline-only`\n   profile of privacy-and-store-declarations instead (the checker prints NOT APPLICABLE there). Read\n   [references\u002Fapi-client-and-transport.md](references\u002Fapi-client-and-transport.md).\n2. Install (stack table, verified 2026-10-03): `npx expo install expo-network` and\n   `npm install -E @tanstack\u002Freact-query@5.104.0 valibot@1.5.0`.\n3. Copy `templates\u002Fsrc\u002Fapi\u002F` (with `tasks\u002F`), `templates\u002Fsrc\u002Fconfig\u002Fapi-base-url.ts` and its test,\n   `templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002F`, and `templates\u002Ftest\u002Fapi\u002F`. The synced files\n   (`src\u002Fcore\u002Fresult.ts`, `src\u002Fconfig\u002Fapp-variant.ts`, `src\u002Fservices\u002Ferror-log\u002F*`,\n   `test\u002Fflush-microtasks.ts`) come from their owner skills: copy them only if the app lacks them.\n4. Environment: declare `EXPO_PUBLIC_API_URL` in `src\u002Fenv.d.ts` and read it in the app's\n   `src\u002Fconfig\u002Fenvironment.ts` as `examples\u002Fenvironment.ts` shows. Setting the value in each EAS\n   environment (`eas env:set --name EXPO_PUBLIC_API_URL --value \u003Chttps-url> --environment \u003Cenv>\n   --visibility plaintext`) is the developer's step: stop and ask before running it.\n5. Composition root: add `api` and `connectivity` to `Services`, `createDeviceServices` and\n   `createTestServices` as in `examples\u002Fcomposition-root\u002F`.\n6. Startup: read the checked environment in the root layout's `decideStartup`\n   (`examples\u002Froot-layout.tsx`), create the client in AppRoot's `startApp` right after the error sink,\n   and render `QueryProvider` right after `AppDataProvider` inside `AppProviders`\n   (`examples\u002Fapp-root.tsx`, `examples\u002Fapp-providers.tsx`; app-startup-and-bootstrap owns the order).\n7. Each resource: replace the Tasks keys, schemas, queries and mutations with the app's own, reading\n   [references\u002Fschemas-and-failures.md](references\u002Fschemas-and-failures.md),\n   [references\u002Fqueries-and-cache.md](references\u002Fqueries-and-cache.md) and\n   [references\u002Fmutations-and-optimistic-updates.md](references\u002Fmutations-and-optimistic-updates.md).\n   Paged lists: `examples\u002Ftask-pages.ts`.\n8. Model hooks: read server state as `examples\u002Fuse-tasks-model.ts` does, turn query state into a view\n   state (`examples\u002Ftask-list-state.ts`) and failures into message keys\n   (`examples\u002Fapi-failure-message.ts`; add the keys to every catalog with i18n-strings-and-catalogs).\n9. Offline needs (a persisted cache, an outbox, sign-out clearing): read\n   [references\u002Fonline-focus-and-offline.md](references\u002Fonline-focus-and-offline.md).\n10. Tests: follow [references\u002Ftesting-server-state.md](references\u002Ftesting-server-state.md); run\n    `npx jest src\u002Fapi src\u002Fconfig src\u002Fservices\u002Fconnectivity test\u002Fapi --ci` and `npm run typecheck`.\n11. Run `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-server-state.mjs .` from the repo root; fix each `FAIL`\n    line (rule ids in [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md)) and rerun until\n    `RESULT: PASS`.\n\n## Definition of done\n\n- [ ] `fetch` appears only in `src\u002Fapi\u002Ffetch-api-client.ts`; no other network API outside `src\u002Fapi\u002F`; no HTTP client package.\n- [ ] `request()` never rejects: fetch and the body read sit in one `try\u002Fcatch`; each attempt has a deadline linked to the caller's signal; every `queryFn` passes `signal`.\n- [ ] Every request names a schema; invalid bodies are recorded once without the data; response schemas are tolerant (`v.object`, `v.fallback` around closed sets).\n- [ ] The base URL comes from `parseApiBaseUrl(process.env.EXPO_PUBLIC_API_URL, variant)` in `src\u002Fconfig`; each EAS environment has its HTTPS value (or the report says the developer still has to set it); no cleartext switch.\n- [ ] Each resource has keys, schemas, `queryOptions` and `mutationOptions` factories in `src\u002Fapi\u002F\u003Cresource>\u002F`, each with its test against the fake ApiClient.\n- [ ] TanStack hooks only in model hooks; one client from `createQueryClient` in AppRoot's `startApp` (a `useState` initializer); `QueryProvider` mounted right after `AppDataProvider`.\n- [ ] Every mutation has a cache effect (or a reasoned `no-cache-effect` marker); optimistic ones cancel, snapshot, roll back and invalidate; retrying writes send an idempotency key.\n- [ ] `npx jest src\u002Fapi src\u002Fconfig src\u002Fservices\u002Fconnectivity test\u002Fapi --ci` passes and `npm run typecheck` is clean; the device checks of testing-server-state.md section 9 ran, or the report says they are owed.\n- [ ] `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-server-state.mjs .` prints `RESULT: PASS`. Expected only before the root layout exists: `SKIP src\u002Fapp\u002F_layout.tsx [managers-wired] not yet created (navigation-and-routing creates it)`. An app without a server prints `NOT APPLICABLE: no app code imports @tanstack\u002Freact-query or calls the network, and there is no src\u002Fapi\u002F`.\n\n## Anti-patterns\n\n- **`fetch` in a hook or a screen \"just for this one call\".** No deadline, no schema, no auth header,\n  no fake in tests; add a query factory in `src\u002Fapi\u002F\u003Cresource>\u002F`.\n- **`await response.json() as Task[]`.** Nothing is checked; the first server change crashes a screen\n  far from the cause. Pass a schema.\n- **Deciding offline from `error.message === 'Network request failed'`.** That text exists only in\n  React Native's fetch; expo\u002Ffetch says `fetch failed: ...`. Ask the signal, the deadline flag and the\n  ConnectivityPort.\n- **`new QueryClient()` at module level or in the layout body.** It outlives logout and is shared by\n  every test, or it is a new empty cache on every render. Create it in a `useState` initializer.\n- **`retry: 3` on a mutation, or keeping TanStack's default retry for queries.** Duplicate writes;\n  seven seconds of spinner before a 404 shows.\n- **`queryKey: ['task', id]` typed inline.** One letter off from `['tasks']`, and the invalidation\n  misses it. Use the key factory.\n- **Copying `query.data` into a Zustand store or `useState` \"to edit it\".** Two copies drift; edit a\n  draft keyed by id, and write through a mutation.\n- **NetInfo or `expo-network` subscribed in a screen or in the onlineManager wiring.** A second native\n  subscription, and on iOS the module's single monitor can be cancelled for good. Read the\n  ConnectivityPort.\n- **Feeding onlineManager from `isInternetReachable`.** On an Android network that never validates\n  (a firewall blocking the probe, \"use this network anyway\") every query stays paused forever while\n  requests would succeed. Feed it `isOnline()`; show `reachability()` in a banner.\n- **An optimistic update without `cancelQueries` or a rollback.** The value flickers back, or a refused\n  write stays on screen.\n- **`usesCleartextTraffic: true` to make a preview build reach `http:\u002F\u002F10.0.2.2`.** It ships to the\n  store; give the API an HTTPS endpoint per environment.\n- **`jest.spyOn(globalThis, 'fetch')`.** Leaks into other tests; pass a fake `FetchLike` or the fake\n  ApiClient.\n- **Persisting the query cache without `buster` and `maxAge`.** Restored data in an old shape skips\n  every schema, and data of any age reappears.\n\n## Files in this skill\n\n| File | What it is | Read\u002Frun when |\n|---|---|---|\n| [references\u002Fapi-client-and-transport.md](references\u002Fapi-client-and-transport.md) | The port, what `fetch` is on iOS and Android in SDK 57, deadlines, cancellation, failure classification, URLs and headers, idempotency, base URL and cleartext per platform, HTTP cache and cookies, verified facts | Workflow steps 1-4 |\n| [references\u002Fschemas-and-failures.md](references\u002Fschemas-and-failures.md) | One schema per response, tolerant reading, transforms, recording invalid responses, the failure family and who handles each kind, `unwrap`\u002F`apiFailureOf` | Workflow steps 7-8 |\n| [references\u002Fqueries-and-cache.md](references\u002Fqueries-and-cache.md) | TanStack defaults, `queryOptions`, key factories, the retry policy, freshness, stacked screens and `subscribed`, status vs fetchStatus, dependent, paged and prefetched queries | Workflow steps 7-8 |\n| [references\u002Fmutations-and-optimistic-updates.md](references\u002Fmutations-and-optimistic-updates.md) | `mutationOptions`, choosing a cache effect, the four optimistic steps, UI-only optimism, concurrent writes, idempotency, conflicts, calling mutations, 5.104 callback signatures | Workflow step 7 |\n| [references\u002Fonline-focus-and-offline.md](references\u002Fonline-focus-and-offline.md) | Why React Native needs manager wiring, the ConnectivityPort on iOS and Android, AppState focus, paused queries and mutations, offline UI, the persisted cache, the outbox split, sign-out | Workflow steps 6 and 9 |\n| [references\u002Ftesting-server-state.md](references\u002Ftesting-server-state.md) | The seam per layer, transport, factory, hook, manager and optimistic tests, timing without fake timers, device checks | Workflow step 10 |\n| [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md) | Every rule id, its scope, the two markers, layout keys, monorepo use, known limits | Workflow step 11, on a FAIL |\n| `templates\u002Fsrc\u002Fapi\u002F` | `api-client.ts`, `api-failure.ts`, `api-error.ts`, `build-url.ts`, `to-api-failure.ts`, `fetch-api-client.ts`, `api-query-options.ts`, `create-query-client.ts`, `query-managers.ts`, `query-provider.tsx`, and their tests; `tasks\u002F` holds the Tasks resource (keys, schemas, queries, mutations with an optimistic toggle and an idempotent create, with tests) | Workflow steps 3 and 7 |\n| `templates\u002Fsrc\u002Fconfig\u002F` | `api-base-url.ts` (`parseApiBaseUrl`, the checked base URL per variant) and its test; `app-variant.ts` and its test are synced from app-variants-and-environment (do not edit here) | Workflow steps 3-4 |\n| `templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002F` | The `ConnectivityPort` (`isOnline` plus the `reachability` hint), its expo-network adapter, the shared `reachability-hub.ts` fan-out and the fake, with tests (this skill owns them; synced from the library, do not edit here) | Workflow step 3 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-log\u002F` | The error log port and fake with its test, synced from architecture-and-boundaries (do not edit here) | Workflow step 3, only if the app lacks them |\n| `templates\u002Fsrc\u002Fcore\u002F` | `result.ts` and its test, synced from error-handling-typed-results (do not edit here) | Workflow step 3, only if the app lacks them |\n| `templates\u002Ftest\u002F` | `api\u002Ffake-api-client.ts`, the scripted ApiClient for tests, and its test; `flush-microtasks.ts`, synced from unit-and-component-tests (do not edit here) | Workflow steps 3 and 10 |\n| `examples\u002Fenvironment.ts` | The app's public-environment reader with the API base URL | Workflow step 4 |\n| `examples\u002Fcomposition-root\u002F` | `Services`, `createDeviceServices`, `createTestServices` with the `api` and `connectivity` ports, and a test | Workflow step 5 |\n| `examples\u002Froot-layout.tsx` | The canonical root layout reading the checked environment in `decideStartup` | Workflow step 6 |\n| `examples\u002Fapp-root.tsx` | The canonical AppRoot creating the QueryClient once in `startApp` | Workflow step 6 |\n| `examples\u002Fapp-providers.tsx` | AppRoot's outer providers with `QueryProvider` right after `AppDataProvider` | Workflow step 6 |\n| `examples\u002Ftask-pages.ts` | A paged list with `infiniteQueryOptions` and a cursor | Workflow step 7 |\n| `examples\u002Fuse-tasks-model.ts` | A model hook over server state (`subscribed: isFocused`, an optimistic toggle) | Workflow step 8 |\n| `examples\u002Fuse-tasks-model.test.tsx` | Testing that hook in a route with the fake ApiClient, offline included | Workflow steps 8 and 10 |\n| `examples\u002Ftask-list-state.ts` | TanStack's status and fetchStatus turned into one view state | Workflow step 8 |\n| `examples\u002Fapi-failure-message.ts` | The message table of the ApiFailure family, with the catalog strings | Workflow step 8 |\n| `scripts\u002Fcheck-server-state.mjs` | The checker (21 rules; options `--src-dir`, `--api-dir`, `--json`) | Workflow step 11, and at the end |\n| `scripts\u002Flib\u002F` | The checker's rule sets and source model, and the synced `source-scan.mjs` (do not edit that one here) | Never by hand |\n| `scripts\u002Fcheck-lib.mjs` | Shared script helper, synced from the library (do not edit here) | Never by hand |\n| `scripts\u002Fselftest.mjs` | Proves the checker passes the templates and examples and catches every planted bug | After changing the checker, a template or an example |\n| `assets\u002Fshared.json` | Declares the shared files this skill copies in | When adding a shared file |\n| `tests\u002F` | The overlay base app (with planted findings in installed-skill folders that must stay silent) and one fixture per rule, plus pass and error cases | When adding a checker rule |\n\n## Related skills\n\n- `error-handling-typed-results` - the Result type, failure families, the error net; the ApiClient is one of its boundaries.\n- `architecture-and-boundaries` - ports, adapters and the composition root the ApiClient and ConnectivityPort join.\n- `app-variants-and-environment` - `EXPO_PUBLIC_*` readers and EAS environments.\n- `state-management-zustand` - client state; no server data in stores (its `server-state-in-store` check).\n- `persistence-and-migrations` - local tables, the outbox and the kv-store adapter under a persisted cache.\n- `auth-and-secure-storage` - tokens, the `headers()` hook and sign-out.\n- `async-safety` - effects, listeners and cancellation outside TanStack Query.\n- `ui-states-and-feedback` - loading, offline and error states on screen.\n- `forms-and-input` - server validation codes mapped to fields.\n- `unit-and-component-tests` - the test app, render helpers and test forms.\n- `privacy-and-store-declarations` - the network inventory and the `offline-only` profile.\n- `admob-ads-and-consent`, `in-app-purchases` - other consumers of the ConnectivityPort.\n- `background-tasks` - syncing the outbox while the app is closed.\n- Expo's official `expo-data-fetching` skill - the Expo fetch API reference.\n",{"name":5,"description":7},"main","41a0e66d4d09de5b46e6537f59a97c7192473486","skills\u002Fnetworking-and-server-state",2,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills","https:\u002F\u002Fzakaria.dev\u002FReactNative-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fzakariaf","https:\u002F\u002Fzakaria.dev","Seniore Software Engineer","2026-10-22 07:05:00",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add zakariaf\u002FReactNative-Skills --skill networking-and-server-state",{"tool":40,"command":41},"bunx","bunx skills add zakariaf\u002FReactNative-Skills --skill networking-and-server-state",{"tool":43,"command":44},"pnpm","pnpm dlx skills add zakariaf\u002FReactNative-Skills --skill networking-and-server-state","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002FSKILL.md",true,[48,54,60,66,70,74,78,82,86,90,94,98,102,106,110,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,304,308,311,315,319,323,327,331,335,339,343,347,351,355,359,363,367,371,375,379,383,387],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"assets\u002Fshared.json","ASSET","资产文件",1174,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fassets\u002Fshared.json",{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Fapi-failure-message.ts","SCRIPT","脚本",1940,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fapi-failure-message.ts",{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"examples\u002Fapp-providers.tsx","OTHER","其他",1592,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fapp-providers.tsx",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"examples\u002Fapp-root.tsx",3833,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fapp-root.tsx",{"path":71,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":72,"sourceHtmlUrl":73},"examples\u002Fcomposition-root\u002Fcreate-device-services.test.ts",1352,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fcomposition-root\u002Fcreate-device-services.test.ts",{"path":75,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":76,"sourceHtmlUrl":77},"examples\u002Fcomposition-root\u002Fcreate-device-services.ts",1567,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fcomposition-root\u002Fcreate-device-services.ts",{"path":79,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":80,"sourceHtmlUrl":81},"examples\u002Fcomposition-root\u002Fcreate-test-services.ts",1212,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fcomposition-root\u002Fcreate-test-services.ts",{"path":83,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":84,"sourceHtmlUrl":85},"examples\u002Fcomposition-root\u002Fservices-context.tsx",1934,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fcomposition-root\u002Fservices-context.tsx",{"path":87,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":88,"sourceHtmlUrl":89},"examples\u002Fenvironment.ts",1426,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fenvironment.ts",{"path":91,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":92,"sourceHtmlUrl":93},"examples\u002Froot-layout.tsx",3092,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Froot-layout.tsx",{"path":95,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":96,"sourceHtmlUrl":97},"examples\u002Ftask-list-state.ts",2524,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Ftask-list-state.ts",{"path":99,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":100,"sourceHtmlUrl":101},"examples\u002Ftask-pages.ts",1570,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Ftask-pages.ts",{"path":103,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":104,"sourceHtmlUrl":105},"examples\u002Fuse-tasks-model.test.tsx",4949,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fuse-tasks-model.test.tsx",{"path":107,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":108,"sourceHtmlUrl":109},"examples\u002Fuse-tasks-model.ts",3027,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fexamples\u002Fuse-tasks-model.ts",{"path":111,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":114,"sourceHtmlUrl":115},"references\u002Fapi-client-and-transport.md","REFERENCE","参考文档",14556,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Freferences\u002Fapi-client-and-transport.md",{"path":117,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":118,"sourceHtmlUrl":119},"references\u002Fchecker-rules.md",10907,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Freferences\u002Fchecker-rules.md",{"path":121,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":122,"sourceHtmlUrl":123},"references\u002Fmutations-and-optimistic-updates.md",11170,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Freferences\u002Fmutations-and-optimistic-updates.md",{"path":125,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":126,"sourceHtmlUrl":127},"references\u002Fonline-focus-and-offline.md",17429,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Freferences\u002Fonline-focus-and-offline.md",{"path":129,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":130,"sourceHtmlUrl":131},"references\u002Fqueries-and-cache.md",12356,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Freferences\u002Fqueries-and-cache.md",{"path":133,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":134,"sourceHtmlUrl":135},"references\u002Fschemas-and-failures.md",7884,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Freferences\u002Fschemas-and-failures.md",{"path":137,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":138,"sourceHtmlUrl":139},"references\u002Ftesting-server-state.md",7903,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Freferences\u002Ftesting-server-state.md",{"path":141,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":142,"sourceHtmlUrl":143},"scripts\u002Fcheck-lib.mjs",119923,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fscripts\u002Fcheck-lib.mjs",{"path":145,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":146,"sourceHtmlUrl":147},"scripts\u002Fcheck-server-state.mjs",8996,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fscripts\u002Fcheck-server-state.mjs",{"path":149,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":150,"sourceHtmlUrl":151},"scripts\u002Flib\u002Fapi-rules.mjs",15522,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fscripts\u002Flib\u002Fapi-rules.mjs",{"path":153,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":154,"sourceHtmlUrl":155},"scripts\u002Flib\u002Fquery-rules.mjs",26841,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fscripts\u002Flib\u002Fquery-rules.mjs",{"path":157,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":158,"sourceHtmlUrl":159},"scripts\u002Flib\u002Fserver-state-source.mjs",6050,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fscripts\u002Flib\u002Fserver-state-source.mjs",{"path":161,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":162,"sourceHtmlUrl":163},"scripts\u002Flib\u002Fsource-scan.mjs",35908,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fscripts\u002Flib\u002Fsource-scan.mjs",{"path":165,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":166,"sourceHtmlUrl":167},"scripts\u002Fselftest.mjs",837,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Fscripts\u002Fselftest.mjs",{"path":169,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":170,"sourceHtmlUrl":171},"templates\u002Fsrc\u002Fapi\u002Fapi-client.ts",2014,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fapi-client.ts",{"path":173,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":174,"sourceHtmlUrl":175},"templates\u002Fsrc\u002Fapi\u002Fapi-error.test.ts",1101,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fapi-error.test.ts",{"path":177,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":178,"sourceHtmlUrl":179},"templates\u002Fsrc\u002Fapi\u002Fapi-error.ts",1271,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fapi-error.ts",{"path":181,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":182,"sourceHtmlUrl":183},"templates\u002Fsrc\u002Fapi\u002Fapi-failure.test.ts",960,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fapi-failure.test.ts",{"path":185,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":186,"sourceHtmlUrl":187},"templates\u002Fsrc\u002Fapi\u002Fapi-failure.ts",2457,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fapi-failure.ts",{"path":189,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":190,"sourceHtmlUrl":191},"templates\u002Fsrc\u002Fapi\u002Fapi-query-options.ts",1337,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fapi-query-options.ts",{"path":193,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":194,"sourceHtmlUrl":195},"templates\u002Fsrc\u002Fapi\u002Fbuild-url.test.ts",1430,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fbuild-url.test.ts",{"path":197,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":198,"sourceHtmlUrl":199},"templates\u002Fsrc\u002Fapi\u002Fbuild-url.ts",1381,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fbuild-url.ts",{"path":201,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":202,"sourceHtmlUrl":203},"templates\u002Fsrc\u002Fapi\u002Fcreate-query-client.test.ts",3088,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fcreate-query-client.test.ts",{"path":205,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":206,"sourceHtmlUrl":207},"templates\u002Fsrc\u002Fapi\u002Fcreate-query-client.ts",2899,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fcreate-query-client.ts",{"path":209,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":210,"sourceHtmlUrl":211},"templates\u002Fsrc\u002Fapi\u002Ffetch-api-client.test.ts",8210,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ffetch-api-client.test.ts",{"path":213,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":214,"sourceHtmlUrl":215},"templates\u002Fsrc\u002Fapi\u002Ffetch-api-client.ts",6468,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ffetch-api-client.ts",{"path":217,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":218,"sourceHtmlUrl":219},"templates\u002Fsrc\u002Fapi\u002Fquery-managers.test.ts",4242,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fquery-managers.test.ts",{"path":221,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":222,"sourceHtmlUrl":223},"templates\u002Fsrc\u002Fapi\u002Fquery-managers.ts",2222,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fquery-managers.ts",{"path":225,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":226,"sourceHtmlUrl":227},"templates\u002Fsrc\u002Fapi\u002Fquery-provider.test.tsx",1753,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fquery-provider.test.tsx",{"path":229,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":230,"sourceHtmlUrl":231},"templates\u002Fsrc\u002Fapi\u002Fquery-provider.tsx",1183,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fquery-provider.tsx",{"path":233,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":234,"sourceHtmlUrl":235},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-keys.test.ts",1438,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-keys.test.ts",{"path":237,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":238,"sourceHtmlUrl":239},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-keys.ts",1090,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-keys.ts",{"path":241,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":242,"sourceHtmlUrl":243},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-mutations.test.ts",3472,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-mutations.test.ts",{"path":245,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":246,"sourceHtmlUrl":247},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-mutations.ts",3244,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-mutations.ts",{"path":249,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":250,"sourceHtmlUrl":251},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-queries.test.ts",3150,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-queries.test.ts",{"path":253,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":254,"sourceHtmlUrl":255},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-queries.ts",1824,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-queries.ts",{"path":257,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":258,"sourceHtmlUrl":259},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-schemas.test.ts",1187,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-schemas.test.ts",{"path":261,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":262,"sourceHtmlUrl":263},"templates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-schemas.ts",1524,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Ftasks\u002Ftask-schemas.ts",{"path":265,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":266,"sourceHtmlUrl":267},"templates\u002Fsrc\u002Fapi\u002Fto-api-failure.test.ts",2614,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fto-api-failure.test.ts",{"path":269,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":270,"sourceHtmlUrl":271},"templates\u002Fsrc\u002Fapi\u002Fto-api-failure.ts",2990,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fapi\u002Fto-api-failure.ts",{"path":273,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":274,"sourceHtmlUrl":275},"templates\u002Fsrc\u002Fconfig\u002Fapi-base-url.test.ts",1548,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fconfig\u002Fapi-base-url.test.ts",{"path":277,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":278,"sourceHtmlUrl":279},"templates\u002Fsrc\u002Fconfig\u002Fapi-base-url.ts",1549,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fconfig\u002Fapi-base-url.ts",{"path":281,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":282,"sourceHtmlUrl":283},"templates\u002Fsrc\u002Fconfig\u002Fapp-variant.test.ts",4182,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fconfig\u002Fapp-variant.test.ts",{"path":285,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":286,"sourceHtmlUrl":287},"templates\u002Fsrc\u002Fconfig\u002Fapp-variant.ts",4370,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fconfig\u002Fapp-variant.ts",{"path":289,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":290,"sourceHtmlUrl":291},"templates\u002Fsrc\u002Fcore\u002Fresult.test.ts",2722,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fcore\u002Fresult.test.ts",{"path":293,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":294,"sourceHtmlUrl":295},"templates\u002Fsrc\u002Fcore\u002Fresult.ts",1831,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fcore\u002Fresult.ts",{"path":297,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":298,"sourceHtmlUrl":299},"templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Fconnectivity-port.ts",1961,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Fconnectivity-port.ts",{"path":301,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":302,"sourceHtmlUrl":303},"templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Fexpo-network-connectivity-adapter.test.ts",5736,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Fexpo-network-connectivity-adapter.test.ts",{"path":305,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":306,"sourceHtmlUrl":307},"templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Fexpo-network-connectivity-adapter.ts",2287,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Fexpo-network-connectivity-adapter.ts",{"path":309,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":298,"sourceHtmlUrl":310},"templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Ffake-connectivity.test.ts","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Ffake-connectivity.test.ts",{"path":312,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":313,"sourceHtmlUrl":314},"templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Ffake-connectivity.ts",1335,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Ffake-connectivity.ts",{"path":316,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":317,"sourceHtmlUrl":318},"templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Freachability-hub.test.ts",1588,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Freachability-hub.test.ts",{"path":320,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":321,"sourceHtmlUrl":322},"templates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Freachability-hub.ts",1943,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Fconnectivity\u002Freachability-hub.ts",{"path":324,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":325,"sourceHtmlUrl":326},"templates\u002Fsrc\u002Fservices\u002Ferror-log\u002Ferror-log-port.ts",941,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-log\u002Ferror-log-port.ts",{"path":328,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":329,"sourceHtmlUrl":330},"templates\u002Fsrc\u002Fservices\u002Ferror-log\u002Ffake-error-log.test.ts",796,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-log\u002Ffake-error-log.test.ts",{"path":332,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":333,"sourceHtmlUrl":334},"templates\u002Fsrc\u002Fservices\u002Ferror-log\u002Ffake-error-log.ts",1176,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-log\u002Ffake-error-log.ts",{"path":336,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":337,"sourceHtmlUrl":338},"templates\u002Ftest\u002Fapi\u002Ffake-api-client.test.ts",2842,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Ftest\u002Fapi\u002Ffake-api-client.test.ts",{"path":340,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":341,"sourceHtmlUrl":342},"templates\u002Ftest\u002Fapi\u002Ffake-api-client.ts",4194,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Ftest\u002Fapi\u002Ffake-api-client.ts",{"path":344,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":345,"sourceHtmlUrl":346},"templates\u002Ftest\u002Fflush-microtasks.ts",358,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftemplates\u002Ftest\u002Fflush-microtasks.ts",{"path":348,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":349,"sourceHtmlUrl":350},"tests\u002Fbases\u002Fapp\u002Fapp.config.ts",544,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fapp\u002Fapp.config.ts",{"path":352,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":353,"sourceHtmlUrl":354},"tests\u002Fbases\u002Fapp\u002Fpackage.json",303,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fapp\u002Fpackage.json",{"path":356,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":357,"sourceHtmlUrl":358},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Ffeatures\u002Ftasks\u002Fcomponents\u002Ftask-row.tsx",553,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Ffeatures\u002Ftasks\u002Fcomponents\u002Ftask-row.tsx",{"path":360,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":361,"sourceHtmlUrl":362},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Ffeatures\u002Ftasks\u002Ftask-list.ts",681,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Ffeatures\u002Ftasks\u002Ftask-list.ts",{"path":364,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":365,"sourceHtmlUrl":366},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Ffeatures\u002Ftasks\u002Ftasks-screen.tsx",636,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Ffeatures\u002Ftasks\u002Ftasks-screen.tsx",{"path":368,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":369,"sourceHtmlUrl":370},"tests\u002Fbases\u002Fapp\u002Ftsconfig.json",129,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fapp\u002Ftsconfig.json",{"path":372,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":373,"sourceHtmlUrl":374},"tests\u002Fbases\u002Fplain\u002Fpackage.json",194,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fplain\u002Fpackage.json",{"path":376,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":377,"sourceHtmlUrl":378},"tests\u002Fbases\u002Fplain\u002Fsrc\u002Fapp\u002Findex.tsx",243,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Fbases\u002Fplain\u002Fsrc\u002Fapp\u002Findex.tsx",{"path":380,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":381,"sourceHtmlUrl":382},"tests\u002Ffixtures\u002Fcheck-server-state\u002FCASES.json",32490,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Ffixtures\u002Fcheck-server-state\u002FCASES.json",{"path":384,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":385,"sourceHtmlUrl":386},"tests\u002Ffixtures\u002Fcheck-server-state\u002Fgood\u002FCASE.txt",188,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Ffixtures\u002Fcheck-server-state\u002Fgood\u002FCASE.txt",{"path":388,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":389,"sourceHtmlUrl":390},"tests\u002Ffixtures\u002Fcheck-server-state\u002FSUITE.json",151,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnetworking-and-server-state\u002Ftests\u002Ffixtures\u002Fcheck-server-state\u002FSUITE.json",[392,399,405,412,419,426],{"skillNo":393,"name":394,"nameZh":6,"description":395,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":396,"categories":397,"keywords":398,"publishedAt":19},"01M7F2S4KZG97D21GEJ2GKKYK1","demo","Planted skill folder (never scanned).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-support\u002Ftests\u002Fbases\u002Fapp\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":400,"name":394,"nameZh":6,"description":401,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":402,"categories":403,"keywords":404,"publishedAt":19},"01M7F2S1F4ATZ49909EDKWA9E6","Planted installed skill (its files must never be scanned).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-support\u002Ftests\u002Fbases\u002Fapp\u002F.agents\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":406,"name":407,"nameZh":6,"description":408,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":409,"categories":410,"keywords":411,"publishedAt":19},"01M7F2RXGPZJ5Q1FV2HQ1PJ6AX","web-support","Ships the web build of an Expo app: platform files, APIs missing in react-native-web, expo-sqlite headers. Use when adding web, a .web.tsx file or expo export --platform web. Not for responsive layout (adaptive-layout).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-support\u002FSKILL.md",[],[],{"skillNo":413,"name":414,"nameZh":6,"description":415,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":416,"categories":417,"keywords":418,"publishedAt":19},"01M7F2RQ43JFA4QFWQEHBET08G","value-objects-money-and-units","Stores money as ISO 4217 minor units, quantities in canonical units, instants as epoch ms. Use when adding a price, currency, tax, split, unit or timestamp, or a total is a cent off. Not for calendar days (dates-streaks-and-statistics).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalue-objects-money-and-units\u002FSKILL.md",[],[],{"skillNo":420,"name":421,"nameZh":6,"description":422,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":423,"categories":424,"keywords":425,"publishedAt":19},"01M7F2RHR7H8VVZDP16FJNJV11","unit-and-component-tests","Sets up Jest, checks unit, component and route tests (RNTL 14, renderWithProviders, SDK mocks, fakes, fast-check, Stryker). Use when writing a test or mock, or Jest fails or flakes. Not for goldens (golden-and-snapshot-tests).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Funit-and-component-tests\u002FSKILL.md",[],[],{"skillNo":427,"name":428,"nameZh":6,"description":429,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":430,"categories":431,"keywords":432,"publishedAt":19},"01M7F2RAEDWQ6H4514HFRWJAE6","ui-states-and-feedback","Builds loading, empty, failed and offline states, delayed skeletons, toasts, banners, confirms, Undo. Use when a screen loads data, shows a spinner, toast, retry or delete prompt. Not for failure values (error-handling-typed-results).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fui-states-and-feedback\u002FSKILL.md",[],[]]