()
| 29 | export const ProductGuidesContext = createContext<ProductGuidesContextT | null>(null) |
| 30 | |
| 31 | export const useProductGuidesContext = (): ProductGuidesContextT => { |
| 32 | const context = useContext(ProductGuidesContext) |
| 33 | |
| 34 | if (!context) { |
| 35 | throw new Error( |
| 36 | '"useProductGuidesContext" may only be used inside "ProductGuidesContext.Provider"' |
| 37 | ) |
| 38 | } |
| 39 | |
| 40 | return context |
| 41 | } |
| 42 | |
| 43 | export const getProductGuidesContextFromRequest = (req: any): ProductGuidesContextT => { |
| 44 | const page = req.context.page |
no outgoing calls
no test coverage detected