Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

v-show alternative for Svelte

The case is that I'm showing Loading component on fetch request. I use store to set $loading to true and inside conditions is the Loading component. The problem is that the Loading component seems to be taking some time to show. It feels/looks like the reason is re-rendering of Loading component. So, I was looking for v-show like thing in Svelte, which I cannot find in Docs. (Don't get angry if its there, just tell me.)

Can anyone help with this case?

like image 634
Yousuf Iqbal Hashim Avatar asked Oct 24 '19 17:10

Yousuf Iqbal Hashim


1 Answers

Either wrap it in an {#if someCondition} block, or slap a hidden={!someCondition} attribute on an element.

like image 50
Rich Harris Avatar answered Oct 03 '22 05:10

Rich Harris