Skip to content

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

Merged
shtaif merged 1 commit intomasterfrom
formatted-iter-idx-arg-bug
Mar 13, 2025
Merged

Fix formatted iterable index argument not accounting for a current-value-holding-iterable correctly#102
shtaif merged 1 commit intomasterfrom
formatted-iter-idx-arg-bug

Conversation

@shtaif
Copy link
Copy Markdown
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