diff --git a/JavaScript/Tasks/1-promisify-problem.js b/JavaScript/Tasks/1-promisify-problem.js index 0170989..a90e9f3 100644 --- a/JavaScript/Tasks/1-promisify-problem.js +++ b/JavaScript/Tasks/1-promisify-problem.js @@ -1,8 +1,10 @@ 'use strict'; -// Task: implement a cancelable promise by passing `timeout: number` -// as an option to the promisified function (last argument, -// replacing the callback). +// Task: implement a cancelable promisify function. +// Allow passing new argument `timeout: number` after the last argument +// to the original function replacing the callback. The promisify should check +// the existence of timeout and apply logic to implement it on top of calling original function +// There is no need to propagate timeout to original function. const promisify = (fn) => (...args) => { const promise = new Promise((resolve, reject) => { diff --git a/JavaScript/Tasks/2-abort-problem.js b/JavaScript/Tasks/2-abort-problem.js index e6646a2..e696c3f 100644 --- a/JavaScript/Tasks/2-abort-problem.js +++ b/JavaScript/Tasks/2-abort-problem.js @@ -1,7 +1,10 @@ 'use strict'; -// Task: implement cancellation by passing `AbortSignal` as an option -// to the promisified function (last argument, replacing the callback). +// Task: implement a cancelable promisify function with AbortController. +// Allow passing new argument `AbortSignal` after the last argument +// to the original function replacing the callback. The promisify should check +// the existence of AbortSignal and apply logic to implement it on top of calling original function +// There is no need to propagate AbortSignal to original function. // Hint: Create `AbortController` or `AbortSignal` in the usage section. const promisify = (fn) => (...args) => { diff --git a/JavaScript/Tasks/4-iterator-problem.js b/JavaScript/Tasks/4-iterator-problem.js index 5785391..9ba6933 100644 --- a/JavaScript/Tasks/4-iterator-problem.js +++ b/JavaScript/Tasks/4-iterator-problem.js @@ -1,8 +1,8 @@ 'use strict'; -// Task: ensure all blocks of code in the usage section iterate in parallel. -// Currently, only the last block (of 3) works. Fix this issue so that -// all blocks can iterate concurrently using a single `Timer` instance. +// Task: ensure all blocks of code in the usage section iterate in parallel +// on the same timer instance getting the same values. Currently, only the last block (of 3) works. +// Update the implementation of Timer so that all blocks can iterate concurrently using a single Timer instance. class Timer { #counter = 0;