Skip to content

Instantly share code, notes, and snippets.

@chiptus
Created July 12, 2020 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiptus/320a8fa0f1036381301cbf90221bfd47 to your computer and use it in GitHub Desktop.
Save chiptus/320a8fa0f1036381301cbf90221bfd47 to your computer and use it in GitHub Desktop.
import {useState} from 'react'
export function useBalanceState(address = '') {
const [balance, setBalance] = useState(0);
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);
...
return {balance, error, loading};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment