Skip to content
Advertisement

Tag: svelte

Is it posible to use a State Machine without using Conditional Statements on the Current State?

I want to use a state machine where the current state is mapped to the current screen. I am using svelte with xstate. Example with string as type: App.svelte machine.js How to do the same with a svelte component instead of a string? Instead of <p>{$toggleService.value}</p> something like this <$toggleService.value /> Edit: What I tried: Create Lobby and Login svelte

Svelte – how to make data not reactive?

I have some HTML elements that have a property color. The value of color will change over time. And I will add more of these label elements in future, but I wish only new elements inherit the new value – effectively, I wish to disable reactivity for this variable. Is this possible in Svelte? Answer Create a property labelColor and

Advertisement