mentie 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  * @param {number} [options.cooldown_in_s=10] - The cooldown time in seconds between retries.
7
7
  * @param {boolean} [options.cooldown_entropy=true] - Whether to add randomness to the cooldown time.
8
8
  * @param {Function} [options.logger=null] - The logger function to log retry attempts.
9
- * @returns {Function} - The retryable function.
9
+ * @returns {Promise<Function>} - The retryable function.
10
10
  * @example
11
11
  * make_retryable( do_thing )
12
12
  * make_retryable( () => fetch( 'https://api.com/data' ) )
@@ -75,10 +75,10 @@ export async function throttle_and_retry( async_function_array=[], { max_paralle
75
75
  const { default: Throttle } = await import( 'promise-parallel-throttle' )
76
76
 
77
77
  // Create array of retryable functions
78
- const retryable_async_functions = async_function_array.map( async_function => {
79
- const retryable_function = make_retryable( async_function, { retry_times, cooldown_in_s, logger, cooldown_entropy } )
78
+ const retryable_async_functions = Promise.all( async_function_array.map( async async_function => {
79
+ const retryable_function = await make_retryable( async_function, { retry_times, cooldown_in_s, logger, cooldown_entropy } )
80
80
  return retryable_function
81
- } )
81
+ } ) )
82
82
 
83
83
  // Throttle configuration
84
84
  const throttle_config = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mentie",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Mentor's toolbelt",
5
5
  "type": "module",
6
6
  "main": "index.js",