use_command

Function use_command 

Source
pub fn use_command<T>(cmd: &'static str) -> UseTauriWithReturn<(), T>
where T: DeserializeOwned + Clone + Send + Sync + 'static,
Expand description

An alias function of use_invoke without options or parameters

#[component]
pub fn Demo() -> impl IntoView {
    let UseTauriWithReturn { 
        data: demo, 
        trigger: list,
        ..
    } = use_command::<Vec<Demo>>("list_data");
     
    view!{
        ...
        <button on:click=move |_| list.set(Some(()))>list data</button>
        ...
    }
}