# @kkt/plugin-pro-rematch

> kktp plugins

Latest version **1.1.5** (published 2023-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kkt/plugin-pro-rematch
pnpm add @kkt/plugin-pro-rematch
yarn add @kkt/plugin-pro-rematch
bun add @kkt/plugin-pro-rematch
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2023-05-29 |
| First published | 2023-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 39.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | SunLxy |
| Maintainers | wcjiang |
| Keywords | kkt, ncc, nodejs, cra, build-tools, create-react-app, zero-configuration, framework |

## Links

- npm: https://www.npmjs.com/package/@kkt/plugin-pro-rematch
- Repository: https://github.com/kktjs/kkt-pro
- Homepage: https://github.com/kktjs/kkt-pro#readme
- Issues: https://github.com/kktjs/kkt-pro/issues
- npm.io page: https://npm.io/package/@kkt/plugin-pro-rematch

## Dependencies (8)

- [redux](https://npm.io/package/redux.md) ^4.2.1
- [chokidar](https://npm.io/package/chokidar.md) ~3.5.3
- [fs-extra](https://npm.io/package/fs-extra.md) ~11.1.0
- [react-redux](https://npm.io/package/react-redux.md) ^8.0.5
- [@rematch/core](https://npm.io/package/@rematch/core.md) 2.2.0
- [@types/fs-extra](https://npm.io/package/@types/fs-extra.md) ~11.0.1
- [@rematch/loading](https://npm.io/package/@rematch/loading.md) 2.1.2
- [@kkt/plugin-pro-utils](https://npm.io/package/@kkt/plugin-pro-utils.md) ^1.1.5

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.1.5 (latest) — 2023-05-29
- 1.0.11-bate.2 (bate) — 2023-04-25
- 0.0.8-alpha.0 (alpha) — 2023-02-11
- 1.1.4 — 2023-05-28
- 1.1.3 — 2023-05-06
- 1.1.2 — 2023-05-04
- 1.1.1 — 2023-05-02
- 1.1.0 — 2023-05-02
- 1.0.14 — 2023-04-26
- 1.0.13 — 2023-04-25
- 1.0.12 — 2023-04-25
- 1.0.11 — 2023-04-25
- 1.0.11-bate.1 — 2023-04-24
- 1.0.10 — 2023-03-25
- 1.0.9 — 2023-03-25
- … 22 more at https://npm.io/package/@kkt/plugin-pro-rematch/versions

## README

## 状态管理

`kktp`内置插件,是以`@rematch/core`包为基础进行自动收集状态管理。使用此插件需要安装`@rematch/core`和`@rematch/loading`包。

## 参数

```ts
export interface ModelspluginProps {
  /**自动生成文件目录名称*/
  cacheDirName?: string;
}
```

## models ts 实例

```ts
// src/models/demo.ts
export interface DemoState {
  test?: string;
}

const demo = {
  name: 'demo',
  state: {
    test: '测试State',
  },
  reducers: {
    updateState: (state: DemoState, payload: DemoState): DemoState => ({
      ...state,
      ...payload,
    }),
  },
  effects: (dispatch) => {
    const { demo } = dispatch;
    return {
      async verify() {
        demo.updateState({ test: '测试22' });
      },
    }
  },
};
export default demo;


// src/pages/ceshi.tsx
import { RootState, useSelector, dispatch } from '@kkt/pro';
const Ceshi = () => {
  // 获取demo数据
  const store = useSelector((store: RootState) => store.demo);
  // Dispatch
  const dispatch = useDispatch<Dispatch>();

  const click = () => {
    dispatch({
      type: 'demo/verify',
      payload: {}
    })
  }
  return <div />
}
export default Ceshi;
```

## 自动收集文件引入

1. 约定`src/**/models/**/*.(js|ts)`文件

## `kktp`配置文件

```ts
// .kktprc.ts
export default {
  // ...
  initModel:true,
}
```

### Contributors

<a href="https://github.com/kktjs/kkt-pro/graphs/contributors">
  <img src="https://kktjs.github.io/kkt-pro/CONTRIBUTORS.svg" />
</a>

### License

Licensed under the MIT License.

---
_Source: https://npm.io/package/@kkt/plugin-pro-rematch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
