Skip to content

Fix formatted iterable index argument not accounting for a current-value-holding-iterable correctly #102

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

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

shtaif
Copy link
Owner

@shtaif shtaif commented Mar 13, 2025

Fixes the following issue regarding formatting async iterables with current values with iterateFormatted's index argument.

Given an async iterable myIter that starts with a current value of '*' and yields 'a' and then 'b';

before the fix we will observe:

<It>{iterateFormatted(myIter, (val, i) => `${val}_${i}`)}</It>

/*
  Will render:

  '*_0' and then
  'a_0' and then
  'b_1'
*/

after the fix we will observe:

<It>{iterateFormatted(myIter, (val, i) => `${val}_${i}`)}</It>

/*
  Will render:

  '*_0' and then
  'a_1' and then
  'b_2'
*/

@shtaif shtaif self-assigned this Mar 13, 2025
@shtaif shtaif marked this pull request as ready for review March 13, 2025 11:21
@shtaif shtaif merged commit 06f97d1 into master Mar 13, 2025
7 checks passed
@shtaif shtaif deleted the formatted-iter-idx-arg-bug branch March 13, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant