react-native-fetch-mock

码农软件 · 软件分类 · React 开源项目 · 2019-04-28 05:58:36

软件介绍

在使用 React Native 的过程中,没有找到一款合适自己的 fetch-mock 组件。

因此,决定自己发布一个 react-native-fetch-mock module。

Roadmap

1. 结合Mock.js(已实现)

2. 配合线上rap系统

Usage

__ mocks__/index.js

export default {
  '/api/path': (options) => {
    const all = Mock.mock({
      'list|2': [{
        'id|+1': 1,
        'name': '@first @last',
        'age|18-54': 1,
      }]
    }).list;
    return Promise.resolve({
      data: all,
    });
  }
}

index.js

import FetchMock from 'react-native-fetch-mock';

if (__dev__) {
  global.fetch = new FetchMock(require('path/to/mocks/directory')).fetch;
}

// if __dev__ is true, it will back the data you defined in mock directory
fetch('/api/path', options);

本文地址:https://codercto.com/soft/d/4540.html

矩阵计算

矩阵计算

Gene H.Golub、Charles F.Van Loan / 袁亚湘 / 人民邮电出版社 / 2011-3-1 / 89.00元

本书是国际上数值计算方面的权威著作,有“圣经”之称。被美国加州大学、斯坦福大学、华盛顿大学、芝加哥大学、中国科学院研究生院等很多世界知名学府用作相关课程的教材或主要参考书。 本书系统地介绍了矩阵计算的基本理论和方法。书中的许多算法都有现成的软件包实现,每节后还附有习题,并有注释和大量参考文献,非常有助于自学。一起来看看 《矩阵计算》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具