How to use the fast-unique-numbers.generateUniqueNumber function in fast-unique-numbers

To help you get started, we’ve selected a few fast-unique-numbers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chrisguttandin / audio-context-timers / src / module.ts View on Github external
export const setInterval = (func: Function, delay: number) => {
    const id = generateUniqueNumber(SCHEDULED_INTERVAL_FUNCTIONS);

    SCHEDULED_INTERVAL_FUNCTIONS.set(id, () => {
        func();

        scheduleFunction(id, delay, 'interval');
    });

    scheduleFunction(id, delay, 'interval');

    return id;
};

fast-unique-numbers

A module to create a set of unique numbers as fast as possible.

MIT
Latest version published 2 months ago

Package Health Score

67 / 100
Full package analysis

Popular fast-unique-numbers functions