1.0.0 • Published 12 months ago

concall v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

⚙️ Installation

npm i concall

CDN 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 times

Support me on PatreonCheck out my socials