Skip to content
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

(fix): concrete signature return types #48

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
2 changes: 1 addition & 1 deletion src/exercises/concrete/concurrencyAbort/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ A concrete example where we employ this strategy is to **deduplicate** calls tha

Implement a function that:

- Signature: `(input: string) => Promise<string>`
- Signature: `(input: string) => Promise<void>`
- Calls `fetchData` (async) with the `input` and calls `setData` (sync) with the result
- Whenever the function is called while it is already running, the latest call should be aborted
2 changes: 1 addition & 1 deletion src/exercises/concrete/concurrencyEnqueue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ A concrete example where we employ this strategy is when showing toasts, where w

Implement a function that:

- Signature: `(input: string) => Promise<string>`
- Signature: `(input: string) => Promise<void>`
- Calls `postData` (async) with the `input`, once all previous calls resolved
- Whenever the function is called while it is already running, subsequent calls should be enqueued and run in order
2 changes: 1 addition & 1 deletion src/exercises/concrete/concurrencyOverride/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In this exercise, we're going to implement a function that calls an async functi

Implement a function that:

- Signature: `(input: string) => Promise<string>`
- Signature: `(input: string) => Promise<void>`
- Calls `fetchFirstData` (async) with the `input`
- Calls `fetchSecondData` (async) with `fetchFirstData` result
- Calls `setData` (sync) with `fetchSecondData` result
Expand Down
2 changes: 1 addition & 1 deletion src/exercises/concrete/parallelCollectErrors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ In this exercise, we'll make calls to `postData` in parallel and collect the err

Implement a function that:

- Signature: `(list: Array<string>) => Promise<Array<string>>`
- Signature: `(list: Array<string>) => Promise<{ successes: Array<string>; errors: Array<unknown> }>`
- Calls `postData` with each element in `list` in parallel
- Returns an object with keys `successes` and `errors`, where `successes` is the list of results of `postData` and `errors` is the list of errors thrown by `postData`
2 changes: 1 addition & 1 deletion src/exercises/concrete/serial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In this case, even though there are **no data dependencies** between these tasks

Implement a function that:

- Signature: `(list: Array<string>) => Promise<string>`
- Signature: `(list: Array<string>) => Promise<Array<string>>`
- Calls `postData` with each item in `list` in order
- Each subsequent `postData` call should wait for the previous one to complete
- Returns a list of the results of each `postData` call in the order they were called
2 changes: 1 addition & 1 deletion src/exercises/concrete/serialCollectErrors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ This exercise is very similar to the `concrete/serial` one, however, in this cas

Implement a function that:

- Signature: `(list: Array<string>) => Promise<Array<string>>`
- Signature: `(list: Array<string>) => Promise<{ successes: Array<string>; errors: Array<unknown> }>`
- Calls `postData` with each element in `list` in series
- Returns an object with keys `successes` and `errors`, where `successes` is the list of results of `postData` and `errors` is the list of errors thrown by `postData`