# chenyaya-promise-catch-loader

> this is loader to add catch after promise.then, the arrowFunction will use The Frist Expression of then.

Latest version **1.0.1** (published 2022-12-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install chenyaya-promise-catch-loader
pnpm add chenyaya-promise-catch-loader
yarn add chenyaya-promise-catch-loader
bun add chenyaya-promise-catch-loader
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-12-08 |
| First published | 2022-12-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ruoruochen |

## Links

- npm: https://www.npmjs.com/package/chenyaya-promise-catch-loader
- npm.io page: https://npm.io/package/chenyaya-promise-catch-loader

## Recent versions

- 1.0.1 (latest) — 2022-12-08
- 1.0.0 — 2022-12-07

## README

# promise-catch-loader

this is loader to add catch after promise.then, the arrowFunction will use The Frist Expression of then.

just Like:

```js
// before: 
Promise.resolve('1').then(res => {
    this.loading = false
    this.handleClose()
})

// after
Promise.resolve('1').then(res => {
    this.loading = false
    this.handleClose()
}).catch(()=>{
    this.loading = false
})

```

## How to use

### install

```shell

npm install chenyaya-promise-catch-loader -D
or
yarn add chenyaya-promise-catch-loader --save-d

```

### Set Webpack Config

```js
const path = require('path')

module.exports = {
    entry:'./src/index.js', 
    output:{
        filename:'bundle.js',
        path:path.resolve(__dirname,'./dist')
    },
    module:{
        rules:[
            {
                test:/\.js$/,
                use:['chenyaya-promise-catch-loader']
            }
        ]
    }
}
```

---
_Source: https://npm.io/package/chenyaya-promise-catch-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
