1.0.0 • Published 2 years ago
concall v1.0.0
⚙️ Installation
npm i concallCDN Links:
📖 Usage
◉ Import
// ES6
import concall from "concall";
// commonjs
const concall = require("concall");◉ Debounce
const func = concall.debounce((text) => {
console.log(text);
}, 2000); // (function, delay)
func("Hello world!");
func("Hello world!");
func("Hello world!");◉ Throttle
const func = concall.throttle((text) => {
console.log(text);
}, 2000); // (function, delay)
func("Hello world!");
func("Hello world!");
func("Hello world!");◉ Delay
const func = concall.delay((text) => {
console.log(text);
}, 2000); // (function, delay)
func("Hello world!");◉ Repeat forever
const func = concall.repeat((text) => {
console.log(text);
}, 2000); // (function, delay)
func("Hello world!");◉ Repeat "n" times
const func = concall.repeat((text) => {
console.log(text);
}, 2000, 2); // (function, delay, times)
func("Hello world!"); // will repeat 2 times1.0.0
2 years ago