0.2.4 • Published 6 years ago

woowahan-initializer v0.2.4

Weekly downloads
163
License
MIT
Repository
github
Last release
6 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

6 years ago

0.2.3

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago