Skip to content
Discussion options

You must be logged in to vote

rust-analyzer can give you the whole concrete type if you do something like let x = session.chats(); and hover on x, and then you can use that type. For example, in the stores example:

#[component]
fn Todos(
    store: Store<Todos>,
    todos: KeyedSubfield<Store<Todos>, Todos, usize, Vec<Todo>>,
) -> impl IntoView {
    view! {
        <For
            each=move || todos
            key=|row| row.id().get()
            let:todo
        >
            <TodoRow store todo/>
        </For>
    }
}

There may be a way to express this using generics as well, but I played around a little and didn't find a good one.

Replies: 2 comments 2 replies

Comment options

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

Comment options

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

Answer selected by mahdi739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants