umi-plugin-dva-connect
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

umi-plugin-dva-connect

NPM version NPM downloads

generate types definitions of dvajs models automatically

Install

# or yarn
$ npm install
$ npm run build --watch
$ npm run start

Usage

Configure in .umirc.js,

export default {
  plugins: [['umi-plugin-dva-connect', options]],
};

Model

with as const

const exampleModel = {
  namespace: 'example',
  state: {
    count: 0,
  },
} as const;

export default exampleModel;

with interface

interface ExampleModel = {
  namespace: 'example';
  state: {
    count: number;
  };
};

const exampleModel: ExampleModel = {
  namespace: 'example',
  state: {
    count: 0,
  },
};

export default exampleModel;

Import from plugin

import { DvaState } from 'umi-plugin-dva-connect';

Options

interface PluginDvaConnectOptions {
  /**
   * `dva-loading` enabled or not.
   * @default
   * true
   */
  loading?: boolean;
  /**
   * name directory in singular.
   * @default
   * false
   */
  singular?: boolean;
}

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i umi-plugin-dva-connect

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

27.7 kB

Total Files

14

Last publish

Collaborators

  • imhele