-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fetch chain configs from config service #596
Conversation
@@ -33,18 +33,16 @@ export const DrainSafeDialog = ({ | |||
isOpen: boolean; | |||
onClose: () => void; | |||
assetBalance: AssetBalance; | |||
nftBalance: NFTBalance; | |||
nftBalance: NFTBalance["results"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this notation. Is the balance type the declared as whatever type the results field is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It refers to the type of the results
field of the NFTBalance
type.
import assetBalanceReducer from "./slices/assetBalanceSlice"; | ||
import collectiblesReducer from "./slices/collectiblesSlice"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so sure I understand these slices and reducers. Could you tell me a bit about them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is how redux
organises it's state. You can store global state in so called slices. We could in theory also put it all into one big slice but like this it is more maintainable and readable.
And Redux is used to store global state. This is to avoid having to drill down the whole app's state through props into all child components who need it.
For instance the balances are needed by different components:
- The component that generates the "Drain" CSV content
- The donation dialog to offer tokens from the user's balance
- The Editor parser to check if the user's balance is high enough for the transfers
- ...
That's why we store it in a global redux state so that all those components can easily retrieve it through selectors.
Everything looks really great! This is a really cool change. I added just a couple questions/comments inline. I'm a bit confused by these slices and reducers... |
Resolves #595
What this PR changes
useSwr
Todos