# modelproxy-engine-wx

> modelproxy中微信小程序的engine

Latest version **3.0.19** (published 2019-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install modelproxy-engine-wx
pnpm add modelproxy-engine-wx
yarn add modelproxy-engine-wx
bun add modelproxy-engine-wx
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.19 |
| Published | 2019-05-14 |
| First published | 2018-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 24 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nick |
| Maintainers | nick121212 |

## Links

- npm: https://www.npmjs.com/package/modelproxy-engine-wx
- npm.io page: https://npm.io/package/modelproxy-engine-wx

## Recent versions

- 3.0.19 (latest) — 2019-05-14
- 3.0.0 — 2019-03-22
- 2.1.3 — 2019-03-05
- 2.0.40 — 2018-12-26
- 2.0.35 — 2018-10-15
- 2.0.34 — 2018-10-15
- 2.0.33 — 2018-10-12
- 2.0.32 — 2018-09-30
- 2.0.31 — 2018-09-27
- 2.0.30 — 2018-09-27
- 2.0.29 — 2018-09-19
- 2.0.28 — 2018-09-17
- 2.0.24 — 2018-09-04
- 2.0.19 — 2018-08-29
- 2.0.18 — 2018-08-28
- … 11 more at https://npm.io/package/modelproxy-engine-wx/versions

## README

# modelproxy-engine-fetch

使用微信小程序提供的调用接口的方法来调用接口的engine。
构造函数中默认传入一个方法，这个方法必须返回promise。

## 支持的设置

1. settings.timeout 设置超时时间，默认为5s。
2. settings.cache   设置缓存，key为fullPath+method，类型为Promise。没有持久化。
3. settings.expire  设置缓存过期时间，单位为毫秒。
4. settings.reload  强制不使用缓存

## 安装

```javascript
npm i modelproxy-engine-wx
```

## demo

```typescript

    import { FetchEngine } from 'modelproxy-engine-wx';

    const engine = new FetchEngine(wepy.request);

    engine.init();

    /**
    * 请求真正的数据接口
    * 返回数据
    */
    engine.use(async (ctx, next) => {
        // 处理想要的逻辑
        await next();
    });

    const proxy = new modelProxy.Proxy();

    proxy.addEngines({"wx":engine});

```

## Licence

MIT

---
_Source: https://npm.io/package/modelproxy-engine-wx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
