会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Nyan
博客园
首页
新随笔
管理
上一页
1
···
16
17
18
19
20
21
22
23
24
···
52
下一页
2019年12月24日
react typescript jest config (一)
摘要: 1. initialize project create a folder project Now we’ll turn this folder into an npm package. This creates a package.json file with default values. 2.
阅读全文
posted @ 2019-12-24 09:30 Nyan
阅读(612)
评论(0)
推荐(0)
2019年12月20日
jest enzyme unit test react
摘要: 1. 测试类型 单元测试:指的是以原件的单元为单位,对软件进行测试。单元可以是一个函数,也可以是一个模块或一个组件,基本特征就是只要输入不变,必定返回同样的输出。一个软件越容易些单元测试,就表明它的模块化结构越好,给模块之间的耦合越弱。React的组件化和函数式编程,天生适合进行单元测试 功能测试:
阅读全文
posted @ 2019-12-20 15:18 Nyan
阅读(550)
评论(0)
推荐(0)
2019年12月19日
【arithmetic】搜索插入位置
摘要: 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置 可以假设数组中无重复元素。 示例 1: 示例 2: 示例 3: result: javascript / @param {number[]} nums @param {number
阅读全文
posted @ 2019-12-19 09:38 Nyan
阅读(184)
评论(0)
推荐(0)
2019年8月2日
es6 新特性
摘要: title: es6 新特性 preview: imgs/preview/es6_1.jpg preview_text: es6 新特性 主要包含“类、模块化、箭头函数、函数参数默认值、模板字符串、解构赋值、延展操作符、对象属性简写、Promise、let与const” tags: javascri
阅读全文
posted @ 2019-08-02 20:22 Nyan
阅读(200)
评论(0)
推荐(0)
React Hooks: useCallback理解
摘要: useCallback把匿名回调“存”起来 避免在component render时候声明匿名方法,因为这些匿名方法会被反复重新声明而无法被多次利用,然后容易造成component反复不必要的渲染。 在Class component当中我们通常将回调函数声明为类成员: 使用useCallback h
阅读全文
posted @ 2019-08-02 10:54 Nyan
阅读(7413)
评论(0)
推荐(1)
2019年8月1日
React Hooks: use modal
摘要: useModal: use:
阅读全文
posted @ 2019-08-01 17:08 Nyan
阅读(2181)
评论(0)
推荐(0)
2019年7月31日
react: typescript system params method optimize
摘要: import * as _ from "lodash"; import paramCache from "../common/param-cache" import RequestPromise from "./axios-service/RequestPromise"; export const fetchSystemParams = () => { return RequestPr...
阅读全文
posted @ 2019-07-31 10:16 Nyan
阅读(217)
评论(0)
推荐(0)
2019年7月30日
react: typescript system params optimize
摘要: 1、system-params-service 2、param-type (filter) 3、param-select component
阅读全文
posted @ 2019-07-30 19:26 Nyan
阅读(207)
评论(0)
推荐(0)
2019年7月26日
react: typescript custom hooks useAsyncTable
摘要: define basic data: declare reducer: define useAsyncTable 传入相应的参数,通过userReducer执行不一样的action更新state数据,使用useEffect监听数据发生变化重新渲染页面 useEffect 监听请求 return re
阅读全文
posted @ 2019-07-26 10:20 Nyan
阅读(370)
评论(0)
推荐(0)
2019年7月25日
json:格式化数据
摘要: formatData = JSON.Stringfy(data, null, 2)
阅读全文
posted @ 2019-07-25 15:26 Nyan
阅读(401)
评论(0)
推荐(0)
上一页
1
···
16
17
18
19
20
21
22
23
24
···
52
下一页
公告