Usage
Save a whole product (legacy-compatible)
Save a specific variant
Wishlist screen
Hook API
isInWishlist and items read the same react-query cache, so every mounted
screen (product hearts, drawer badge, wishlist list) stays in sync: each
mutation invalidates sdkKeys.wishlist() and the list refetches from the
service’s in-memory state.
Service API
getItems() returns copies (including selectedOptions), so callers cannot
mutate the service’s internal state.
Storage and migration
On the first boot after upgrading, the service reads the legacy list,
normalizes it (
id = productId, createdAt/updatedAt/addedAt from the
stored addedAt), writes wishlist_v2, and removes the legacy key. The
migration is one-time and idempotent: later boots read wishlist_v2 directly.
Duplicate entries are de-duplicated by id (first occurrence wins), unusable
entries are dropped, and a corrupt stored value is treated as an empty
wishlist — a bad value never blocks app start.
How It Works
- Initialized from AsyncStorage when
StackfrontProvidermounts, beforereadyflips. - All mutations update in-memory state and persist to
wishlist_v2. isInWishlistis synchronous — no async check needed.- The wishlist is per device. Server sync (Firebase/Supabase adapters) is out of scope.

