source: node_modules/es-toolkit/dist/compat/function/after.d.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 839 bytes
Line 
1/**
2 * The opposite of `_.before`; this method creates a function that invokes
3 * `func` once it's called `n` or more times.
4 *
5 * @template TFunc - The type of the function to be invoked.
6 * @param {number} n - The number of calls before `func` is invoked.
7 * @param {TFunc} func - The function to restrict.
8 * @returns {TFunc} Returns the new restricted function.
9 * @throws {TypeError} - If `func` is not a function.
10 *
11 * @example
12 * const saves = ['profile', 'settings'];
13 * const done = after(saves.length, () => {
14 * console.log('done saving!');
15 * });
16 *
17 * saves.forEach(type => {
18 * asyncSave({ 'type': type, 'complete': done });
19 * });
20 * // => Logs 'done saving!' after the two async saves have completed.
21 */
22declare function after<TFunc extends (...args: any[]) => any>(n: number, func: TFunc): TFunc;
23
24export { after };
Note: See TracBrowser for help on using the repository browser.