envoylabs / whoami-ui

A UI for the whoami NFT-based nameservice
whoami-ui.vercel.app
Apache License 2.0
9 stars 3 forks source link

Add more general handling for react hooks short-circuiting #101

Open the-frey opened 2 years ago

the-frey commented 2 years ago

At the top of react hooks, we have a lot of short-circuit code like

    if (!tokenName || !signingClient || !walletAddress) {
      return
    }

basically we should identify all the query/guard cases, make a namespace of them, add some unit tests and stick it under utils. Then just say e.g.

if (noTokenClientAddress(name, client, address)) return

obviously with a better name than that 😂