0.0.3 • Published 4 years ago

build-plugin-store v0.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

BUILD-PLUGIN-STORE

descript

Basic plugin help user use store. This plugin support three types of data management. (icestore、rematch、mobx)

use

  tnpm i --save-dev build-plugin-store
// build.json

{
  "plugins": [
    "build-plugin-store"
  ]
}

options

storePath: specify store file (this plugin won't generate store code and it will resolve ice/rematch to user's specify store file). storeType: which data management type use. icestore|rematch|mobx

config

rematch

// src/app.ts

export const rematch = {
  plugins: [plugins],
};

// config = rematch 将自动加入 init 参数中
// init({ ...config, models });

(icestore)https://ice.alibaba-inc.com/docs/icestore/guide/middleware

// src/app.ts

export const icestore = {
  middlewares: [
    [[a, b, c]],
    [[d, e], 'foo'],
  ]
};

/**
  将转换为

  storeManager.applyMiddleware([a, b, c]);
  storeManager.applyMiddleware([d, e], 'foo');
*/