You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: clarify useIAP hook state-driven design pattern in llms.txt
- Add Design Pattern section explaining void-returning methods
- Clearly separate STATE VARIABLES from METHODS
- Add Usage Pattern examples showing correct vs incorrect usage
- Note difference between hook getAvailablePurchases (void) and root API (Purchase[])
- Mark exceptions that return values (hasActiveSubscriptions, verifyPurchase, etc.)
Copy file name to clipboardExpand all lines: docs/static/llms.txt
+40-10Lines changed: 40 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -57,31 +57,59 @@ function Store() {
57
57
58
58
The main interface for in-app purchases. Auto-manages connection lifecycle.
59
59
60
+
**Design Pattern:** The hook follows React's state-driven pattern. Methods return `Promise<void>` and update internal state. You must read data from the returned state variables, not from method return values.
**Note:** The root API `getAvailablePurchases` returns `Promise<Purchase[]>`, while the hook's `getAvailablePurchases` returns `Promise<void>` and updates internal state.
0 commit comments