ui-app
v0.3.0
Published
Common elements to setting up a UI project.
Downloads
11
Keywords
Readme
UI-App
Reducing Web and Native application boilerplate.
Complete Example
import App from 'ui-app/web'
/**
* The main application.
*/
class MyApp extends App {
constructor(...args) {
super(...args)
// Redux-persist runs automatically, supply a whitelist of
// store keys to persist.
this.persistWhitelist = [
'auth'
]
// Able to swtich off dev-tools for performance reasons, if needed.
this.noDevTools = true
// Specify an application version to be displayed each time the app
// is run in order to help identify the current bundle.
this.version = '0.1.0'
}
/**
* Return a dictionary of reducers to add to Redux.
*/
getReducers() {
return {
...super.getReducers(),
auth: require('auth/reducers').default
}
}
/**
* Return a list of root sagas to run.
*/
getSagas() {
return [
...super.getSagas(),
require('auth/sagas').default()
]
}
/**
* Load the primary React component to mount and render.
*/
loadMainComponent() {
return require('./MainView').default
}
/**
* The entrypoint of the application, add in any special
* operations you need to perform here.
*/
run() {
super.run()
}
}
/*
* Begin firing up our application.
*/
const app = new MyApp()
app.run()
export default app