【发布时间】:2017-06-22 03:55:00
【问题描述】:
我正在用react学习Flow,当我导入一些模块时,流找不到模块。
import axios from "axios"; //requied module not found
export const fetchPopularRepos = (lang: string) => {
var encodedURI = window.encodeURI( // flow not covered
"https://api.github.com/search/repositories?q=stars:>1 + language:" +
lang +
"&sort=stars&order=desc&type=Repositories"
);
return axios.get(encodedURI).then(response => response.data.items);
};
//flow not covered
export function getProfile(username: string) {
return axios
.get(`https://api.github.com/users/${username}${params}`)
.then(user => user.data);
}
- 如何设置为不检查模块
- 如何覆盖
window.encodeURI和axios
【问题讨论】: