Skip to content

Can I use the Tauri backend as an alternative to Redux or useState()? #4940

Answered by FabianLars
skorotkiewicz asked this question in Q&A
Discussion options

You must be logged in to vote

You can't really replace useState(), but Redux may be possible if you currently aren't "abusing" Redux. Just keep in mind that setting/receiving the state will be slightly slower because of the IPC round trip. Shouldn't be noticeable unless you're sending >1mb payloads.
Oh and not to forget, Tauri's api are async, mentioning it in case it's a no-go for you.

That said, i do use tauri::State as a cache for my routes too, especially to handle page refreshes.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by skorotkiewicz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants