wasei-useful-util
v1.1.3
Published
一个javascript工具库,提供基础、性能优化、dom交互、动画、异步、移动端、请求类等日常开发中常用的函数
Downloads
38
Maintainers
Readme
wasei-useful-util
一个javascript工具库,提供基础、性能优化、dom交互、动画、异步、移动端、请求类等日常开发中常用的函数
安装
npm install -S wasei-useful-util
引用
CommonJS
const { general } = require('wasei-useful-util'); //全局引用
const general = require('wasei-useful-util/general'); //按需引用
const finalFunc1 = general.chain(result => result * 10).chain((n1, n2) => n1 + n2);
console.log(finalFunc1(1, 2)); // => 30
ES Module
import util from 'wasei-useful-util'; //全局引用
import general from 'wasei-useful-util/general'; //按需引用
const finalFunc = util.general.chain(result => result * 10).chain((n1, n2) => n1 + n2);
const finalFunc1 = general.chain(result => result * 10).chain((n1, n2) => n1 + n2);
console.log(finalFunc(1, 2), finalFunc1(1, 2)); // => 30
or webpack下
import { general } from 'wasei-useful-util'; //全局引用
import { formatAmount } from 'wasei-useful-util/general'; //按需引用
const finalFunc1 = general.chain(result => result * 10).chain((n1, n2) => n1 + n2);
console.log(finalFunc1(1, 2)); // => 30
Browser
const general = window[ 'wasei-useful-util' ].general
const finalFunc1 = general.chain(result => result * 10).chain((n1, n2) => n1 + n2);
console.log(finalFunc1(1, 2)); // => 30
模块
- general
- animate
- async
- HttpClient
- interaction
- mobile
- performance-optimize