mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-06 09:09:09 +08:00
10 lines
263 B
TypeScript
10 lines
263 B
TypeScript
export const sleep = (time: number) => {
|
|
return new Promise(resolve => setTimeout(resolve, time))
|
|
}
|
|
|
|
export const mockNativeEvent = (fn: Function = () => {}) => ({
|
|
nativeEvent: { stopImmediatePropagation: fn }
|
|
})
|
|
|
|
export const nativeEvent = mockNativeEvent()
|