Skip to content
Discussion options

You must be logged in to vote

I have never used Tauri so I'm probably the wrong person to answer. But I'll try.

attempting to migrate from Svelte to Tauri

Do you mean Svelte to Leptos?

In Tauri with Leptos, 'invoke' is wasm_bindgen fn:

Just to be clear there's no Leptos functionality in this snippet, it's just wasm-bindgen.

Here's how you might do something like this:

let navigate = use_navigate();
let params = use_params_map();
let data = LocalResource::new(move || {
    let foo = params.read().get("foo");
    async move {
        match foo {
            Some(value) => {
                let result = invoke(/* ... */).await;
                if result.is_an_error() {
                    navigate("/", Default::default(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tb1281
Comment options

Answer selected by Tb1281
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