Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invar: the unconditional fence #98

Merged
merged 2 commits into from
Apr 10, 2024
Merged

invar: the unconditional fence #98

merged 2 commits into from
Apr 10, 2024

Conversation

maciejhirsz
Copy link
Owner

I found that I have some place that use params but always produce static DOM, so a way to make an entire component static rather than just few strings with the static keyword is useful.

Before 0.10 is released this might be worth putting into the #[component] macro as #[component(static)].

use kobold::prelude::*;
use kobold::diff::invar;

#[component]
fn tag(label: &'static str) -> impl View {
    invar(move || view! {
        <span.tag>{ static label }</span>
    })
}

@maciejhirsz maciejhirsz merged commit cfd3bef into master Apr 10, 2024
4 checks passed
@maciejhirsz maciejhirsz deleted the invar branch April 10, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant