Repository navigation
netwrap v4.0.0
Date: 2026-01-19
Highlights
- New client entry point:
netwrap/clientfor React hooks and client-only usage. useFetcherhook for client components with loading/error/data state.- Clear split between server-safe utilities (
netwrap) and client hooks (netwrap/client).
Deprecations
- Using
fetcherinside client components is deprecated. UseuseFetcherinstead.
Migration Notes
- Update client components to import hooks from
netwrap/client. - If you rely on
fetcherin client components, plan to migrate touseFetcher.
API Summary
fetcher(options)
Returns:
trigger(triggerData?)dataerrorisLoadinggetData()getError()getIsLoading()onLoadingChange(listener)onDataChange(listener)onErrorChange(listener)invalidateCache()
useFetcher(options)
Returns:
trigger(triggerData?)dataerrorisLoadinginvalidateCache()
Notes
useFetchermust be imported fromnetwrap/clientand used only in client components.fetcheris not reactive; avoid destructuringdataorerrorif you expect live updates.fetchercache is instance-local; recreate the instance to reset the cache.