1- import { createResource , createSignal , Resource } from " solid-js" ;
2- import { render } from " solid-js/web" ;
3- import { createClient } from " ./index" ;
1+ import { createResource , createSignal , Resource } from ' solid-js' ;
2+ import { render } from ' solid-js/web' ;
3+ import { createClient } from ' ./index' ;
44
5- const [ email , setEmail ] = createSignal ( "" ) ;
6- const client = createClient ( " http://localhost:8080/graphql" ) ;
5+ const [ email , setEmail ] = createSignal ( '' ) ;
6+ const client = createClient ( ' http://localhost:8080/graphql/' ) ;
77
88function formSubmit (
99 ref : HTMLFormElement ,
10- accessor : ( ) => ( ( ref : HTMLFormElement ) => any ) | undefined
10+ accessor : ( ) => ( ( ref : HTMLFormElement ) => any ) | undefined ,
1111) {
12- const cb = accessor ( ) ?? ( ( ) => { } )
13- ref . setAttribute ( " novalidate" , "" ) ;
12+ const cb = accessor ( ) ?? ( ( ) => { } ) ;
13+ ref . setAttribute ( ' novalidate' , '' ) ;
1414 ref . onsubmit = async ( e ) => {
1515 e . preventDefault ( ) ;
1616 return await Promise . resolve ( cb ( ref ) ) ;
1717 } ;
1818}
1919
20- function Result ( props : { data : Resource < any > } ) {
20+ function Result ( props : { data : Resource < any > } ) {
2121 return (
2222 < div >
2323 < div > result: { JSON . stringify ( props . data ( ) ) } </ div >
@@ -28,7 +28,7 @@ function Result(props: { data: Resource<any> }) {
2828}
2929
3030function VerifyInput ( ) {
31- const [ code , setCode ] = createSignal ( "" ) ;
31+ const [ code , setCode ] = createSignal ( '' ) ;
3232 const buttonEnabled = ( ) => code ( ) && email ( ) ;
3333 const [ params , setParams ] = createSignal < null | {
3434 email : string ;
@@ -38,7 +38,7 @@ function VerifyInput() {
3838 const [ data ] = createResource ( params , client . verifyCode ) ;
3939
4040 return (
41- < form use :formSubmit = { ( ) => setParams ( { email : email ( ) , code : code ( ) } ) } >
41+ < form use :formSubmit = { ( ) => setParams ( { email : email ( ) , code : code ( ) } ) } >
4242 < input
4343 type = "text"
4444 placeholder = "email"
@@ -60,7 +60,7 @@ function VerifyInput() {
6060}
6161
6262function Permissions ( ) {
63- const [ data , { refetch } ] = createResource ( ( ) => client . permissions ( { } ) ) ;
63+ const [ data , { refetch} ] = createResource ( ( ) => client . permissions ( { } ) ) ;
6464
6565 return (
6666 < form use :formSubmit = { ( ) => refetch ( ) } >
@@ -79,4 +79,4 @@ function App() {
7979 ) ;
8080}
8181
82- render ( ( ) => < App /> , document . getElementById ( " app" ) as HTMLElement ) ;
82+ render ( ( ) => < App /> , document . getElementById ( ' app' ) as HTMLElement ) ;
0 commit comments