Skip to content

doc: improve description of tasks #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions JavaScript/Tasks/1-promisify-problem.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
7 changes: 5 additions & 2 deletions JavaScript/Tasks/2-abort-problem.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
6 changes: 3 additions & 3 deletions JavaScript/Tasks/4-iterator-problem.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy