-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Labels
Milestone
Description
This is possible:
{#each [1,2,3].filter(x => x%2) as f(f)}
<div animate:flip />
{/each}But this isn't:
{#each [1,2,3] as f(f)}
{#if f%2}
<div animate:flip />
{/if}
{/each}I'm in a situation where It would be very convenient to create different element depending on the {#each} block values with an {#if} block, while still being able to use the animate directive.
The only alternative would be to iterate the object twice (also filtering it twice), and use the crossfade transition, which wouldn't be nearly as efficient nor working as flawlessly as with the flip animation (see #4389).