Skip to content

v4.0.0

Latest

Choose a tag to compare

@tylerdgenius tylerdgenius released this 19 Jan 06:55
· 1 commit to master since this release

netwrap v4.0.0

Date: 2026-01-19

Highlights

  • New client entry point: netwrap/client for React hooks and client-only usage.
  • useFetcher hook for client components with loading/error/data state.
  • Clear split between server-safe utilities (netwrap) and client hooks (netwrap/client).

Deprecations

  • Using fetcher inside client components is deprecated. Use useFetcher instead.

Migration Notes

  • Update client components to import hooks from netwrap/client.
  • If you rely on fetcher in client components, plan to migrate to useFetcher.

API Summary

fetcher(options)

Returns:

  • trigger(triggerData?)
  • data
  • error
  • isLoading
  • getData()
  • getError()
  • getIsLoading()
  • onLoadingChange(listener)
  • onDataChange(listener)
  • onErrorChange(listener)
  • invalidateCache()

useFetcher(options)

Returns:

  • trigger(triggerData?)
  • data
  • error
  • isLoading
  • invalidateCache()

Notes

  • useFetcher must be imported from netwrap/client and used only in client components.
  • fetcher is not reactive; avoid destructuring data or error if you expect live updates.
  • fetcher cache is instance-local; recreate the instance to reset the cache.