UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 318 B
import{useEffect as f,useState as t}from"react";import{isValidLicense as c}from"./is-valid-license.js";import{parseToken as l}from"./parse-token.js";function p(e){const[i,s]=t(!1),[o,n]=t(!0);return f(()=>{async function a(){const r=await l(e);s(c(r)),n(!1)}a()},[e]),{loading:o,isValid:i}}export{p as useLicenseKey};