Skip to content

JavanShen/n-typical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n-typical

基于 typical

✨ 扩展功能

  • 🥪 完整的TS类型支持
  • 🥖 更直观的循环方式
  • 🍦 循环结束回调

demo-pic

📦 安装

npm i n-typical

🔨 使用

import { type } from 'n-typical'

type(element, ['text', 1000, 'text next'], 3, () => {
    // each cycle finish
})

📖 API

(
    target: HTMLElement | Element | null | undefined,
    actions: (string | number | (() => unknown))[],
    loop?: number,
    cb?: () => unknown
) => Promise<void>
参数 描述
target 所需要控制的元素
actions 由字符串数字和方法所组成的数组
loop 循换次数,如需无限循环可传 Infinity
cb 每一次结束会触发的回调

About

基于 typical 的二次封装

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published