File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed
projects/packages/forms/src/store/config Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,22 @@ const fetchConfigData = async ( dispatch: ( action: ConfigAction ) => void ) =>
2020 }
2121} ;
2222
23- export const getConfig = {
24- fulfill :
25- ( ) =>
26- async ( { dispatch } : { dispatch : ( action : ConfigAction ) => void } ) => {
27- await fetchConfigData ( dispatch ) ;
28- } ,
29- isFulfilled : ( state : ConfigState ) => {
30- // Consider fulfilled if config exists or is currently loading
31- return state . config !== null || state . isLoading ;
32- } ,
33- shouldInvalidate : ( action : ConfigAction ) => {
34- return action . type === INVALIDATE_CONFIG ;
35- } ,
23+ /**
24+ * Resolver to fetch config data.
25+ *
26+ * @return {Function } The resolver function.
27+ */
28+ export function getConfig ( ) {
29+ return async ( { dispatch } : { dispatch : ( action : ConfigAction ) => void } ) => {
30+ await fetchConfigData ( dispatch ) ;
31+ } ;
32+ }
33+
34+ getConfig . isFulfilled = ( state : ConfigState ) => {
35+ // Consider fulfilled if config exists or is currently loading
36+ return state . config !== null || state . isLoading ;
37+ } ;
38+
39+ getConfig . shouldInvalidate = ( action : ConfigAction ) => {
40+ return action . type === INVALIDATE_CONFIG ;
3641} ;
You can’t perform that action at this time.
0 commit comments