0.2.4 • Published 8 years ago

woowahan-initializer v0.2.4

Weekly downloads
163
License
MIT
Repository
github
Last release
8 years ago

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);
  }
});
0.2.4

8 years ago

0.2.3

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago