0.0.1-alpha.4 • Published 3 years ago

fetch-with-hook v0.0.1-alpha.4

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

fetch-with-hook

npm.io license Build Status Coveralls npm

:star: 特性

  • 拦截页面上发出的所有fetch请求
  • 可以修改请求
  • 可以修改响应

注意: 必须先执行 fetchHook 再调用 fetch, 建议把 fetchHook 的代码放在应用的最顶部或入口处.

:open_file_folder: 目录介绍

.
├── demo 使用demo
├── dist 编译产出代码
├── doc 项目文档
├── src 源代码目录
├── test 单元测试
└── CHANGELOG.md 变更日志

:rocket: 使用者指南

通过npm下载安装代码

$ npm install --save fetch-with-hook

如果你是webpack等环境

import base from 'fetch-with-hook';

如果你是requirejs环境

requirejs(['node_modules/fetch-with-hook/dist/index.aio.js'], function (base) {
    // xxx
})

如果你是浏览器环境

<script src="node_modules/fetch-with-hook/dist/index.aio.js"></script>
0.0.1-alpha.4

3 years ago

0.0.1-alpha.3

3 years ago

0.0.1-alpha.2

3 years ago

0.0.1-alpha.1

3 years ago

1.0.0

3 years ago