Skip to content

woowabros/woowahan-initializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

woowahan-initializer

Component initializer middleware for woowahanjs

requirements

  • woowahanjs v0.3.0 higher

Install

$ npm install --save-dev woowahan-initializer

Setup

import Woowahan from 'woowahan';
import Initializer from 'woowahan-initializer';

const app = new Woowahan();

app.set(Initializer);

app.use(Woowahan.Store.create({
  config: {
    env: 'development',
    cache: true
  }
}));

Use

import Woowahan from 'woowahan';

export default Woowahan.View.create('myView', {

  initConfig: {
    initModel: {
      loaded: true
    },

    loadStore: ['config'],

    after() {
      console.log(this.getModel()); // { config }
    }
  },

  viewDidMount() {
    let { config, loaded } = this.getModel();
    
    console.log(config, loaded);
  }
});

About

Component initializer middleware for woowahanjs

Resources

License

Stars

Watchers

Forks

Packages

No packages published