Type guard to check if GetProducts response is completed. Automatically narrows response type to GetProductsResponse.
onGetProductsStatusChange: (response, metadata) => { if (isGetProductsCompleted(metadata, response)) { console.log(response.products); // ✅ TypeScript knows products exists }} Copy
onGetProductsStatusChange: (response, metadata) => { if (isGetProductsCompleted(metadata, response)) { console.log(response.products); // ✅ TypeScript knows products exists }}
Type guard to check if GetProducts response is completed. Automatically narrows response type to GetProductsResponse.