-
Notifications
You must be signed in to change notification settings - Fork 106
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(Carta Giovani Nazionale): [#176958889] Implementation of the redux store/actions section for Merchants list load and storage #2843
Conversation
Co-authored-by: Matteo Boschi <[email protected]>
Co-authored-by: Matteo Boschi <[email protected]>
Co-authored-by: fabriziofff <[email protected]>
Co-authored-by: fabriziofff <[email protected]>
Co-authored-by: fabriziofff <[email protected]>
Co-authored-by: fabriziofff <[email protected]>
…66-cgn-details-screen
Co-authored-by: fabriziofff <[email protected]>
Co-authored-by: fabriziofff <[email protected]>
Co-authored-by: fabriziofff <[email protected]>
…766-cgn-details-screen
…76703766-cgn-details-screen
…m:pagopa/io-app into 176958889-store-reducer-cgn-merchants
import { cgnMerchants } from "../actions/merchants"; | ||
|
||
export type CgnMerchantsState = { | ||
list: pot.Pot<ReadonlyArray<any>, NetworkError>; |
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.
list: pot.Pot<ReadonlyArray<any>, NetworkError>; | |
merchants: pot.Pot<ReadonlyArray<any>, NetworkError>; |
Could it be a more descriptive name?
tip: if this store section includes only merchants, it can be directly the merchants list
export type CgnMerchantsState = pot.Pot<ReadonlyArray<any>, NetworkError>;
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.
@Undermaken
I used merchants as the attribute name in the CgnState
since this section should have inside the merchants list and the selected merchant to show it's detail avoiding a navigation parameter. This was how i figured out the store:
{
...globalState,
cgn: {
..cgnState,
merchants: {
list: [],
selectedMerchant: {}
}
}
}
what do you think?
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.
Good for me if this section will store also other data
"CGN_MERCHANTS_REQUEST", | ||
"CGN_MERCHANTS_SUCCESS", | ||
"CGN_MERCHANTS_FAILURE" | ||
)<void, ReadonlyArray<any>, NetworkError>(); |
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.
We should avoid to use any
I guess it is just a placeholder but if we forget to replace it we can use the action and the reducer with no warnings from compiler.
Could instead possibile to create and use a temporary type?
type CGNMerchant = unknown;
This PR Depens on #2807
Short description
This PR adds the scaffolding implementation of the store and reducer for CGN merchants list