1.5.2 • Published 2 years ago

@prequest/timeout v1.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@prequest/timeout

超时中间件。对于不支持设置超时时间的请求内核,你可以安装超时中间件来获得超时响应失败的能力。

对于一些本不支持设置超时时间的请求内核以及 Fetch 来说,没有办法真正的在超时之后,取消请求。只能使用超时抛异常的方式来满足需求。

安装

npm install @prequest/timeout

使用

import { create, PreQuest } from '@prequest/xhr'
import timeout from '@prequest/timeout'

PreQuest.use(timeout)

PreQuest.defaults.timeout = 1000

const prequest = create({ timeout: 6000 })

prequest('/api', { timeout: 1000 })
1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.5

2 years ago

1.3.3-alpha.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.2.6

2 years ago

1.2.4

3 years ago

1.2.0

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.2.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.1-alpha.0

3 years ago

1.0.0-alpha.0

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago