ui-app

0.3.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i ui-app

Weekly Downloads

18

Version

0.3.0

License

UNLICENSED

Unpacked Size

22.7 kB

Total Files

9

Last publish

Collaborators

  • dreadera
  • williamchuuptick
  • uptick-admin
  • bor3ham
  • jlo-1
  • jarekwg
  • alexdonald
  • marcfister
  • furious.luke