Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Svelte 5 library for syncing any remote states

$
0
0

I have an existing Svelte 4 app which uses stores.I would like to rewrite it to Svelte 5 and make reusable function or class which synchronizes reactive states (runes) for any app states. $states should be synchronized both ways (like bind in components) some only one way (send) like $derived.

Backend can be MQTT or WebSocket and it is synchronizing states between clients.There can be tens of variables to sync and I don't want to write 20 $effects for sending and 20 ifs for subscriptions.

MQTT Component with $bindable props would maybe work, but as I understand components should be mounted to DOM, and syncing variables to MQTT has nothing to do with DOM.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>