Created
July 1, 2016 10:26
-
-
Save PolGuixe/42c572704986b79ea3ce2a8f80ad2409 to your computer and use it in GitHub Desktop.
Add a way to set default loading and error components #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside client/modules/core/configs/index.js | |
import reactKomposerConfig from './react-komposer-config'; | |
export default function (context) { | |
reactKomposerConfig(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside client/modules/core/index.js | |
import actions from './actions'; | |
import routes from './routes.jsx'; | |
import configs from './configs'; | |
export default { | |
routes, | |
actions, | |
load(context) { | |
configs(context); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside client/modules/core/configs/react-komposer-configs.js | |
import {setDefaultErrorComponent, setDefaultLoadingComponent} from 'react-komposer'; | |
const ErrorComponent = () => ( | |
<div>My Error</div> | |
); | |
const LoadingComponent = () => ( | |
<div>My Loading</div> | |
); | |
export default function() { | |
setDefaultErrorComponent(ErrorComponent); | |
setDefaultLoadingComponent(LoadingComponent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment