Fetch resources on load for React hooks instead of asking devs to call it in a useEffect
#116
Labels
Type: Enhancement
Added to issues and PRs when a change includes improvements or optimizations.
For
useSprinterTokens
,useSprinterChains
anduseSprinterBalances
, we request users to call a corresponding getter function such asgetUserBalances
in auseEffect
.I'd propose to remove this, or to call it
refresh
, and to actually call the relevant function right on load.e.g users could have:
on address change (in
useSprinterBalances
), the balances would be refetched, and if the users for some reason want to programmatically refresh, they can call therefresh
.This is more in line with the hooks I'm used to use. WDYT @BeroBurny @saadahmsiddiqui ?
The text was updated successfully, but these errors were encountered: