Skip to content

Send redux action to load data, and then wait loading component until check function return true

License

Notifications You must be signed in to change notification settings

KenguruKleo/with-load-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HOC withLoadData

Send Redux action to load data, and return null instead wrapped Component until check function returns true

Usage:

    withLoadData({
        actionLoadData,
        checkIsDataLoaded,
    })(Component)
  • HOC connect component to Redux store
  • actionLoadData({ componentProps }) will bind to redux dispatch, so it can be regular Redux action and pass component props to action
  • checkIsDataLoaded receive state as a param, so we have access to redux state

About

Send redux action to load data, and then wait loading component until check function return true

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published