1. Куча / Говнокод #29283

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    #[page]
    pub async fn page(cx: &Cx) -> Result<impl View> {
        // This state variable is initialized on the server, but lives in the browser.
        let count = signal(cx, || 0i32);
    
        Ok(view! {
            <button @click=$(|_e| count.increment())>"increment"</button>
            <button @click=$(|_e| count.decrement())>"decrement"</button>
    
            // The count updates when clicking the buttons. No server roundtrip.
            <div>$(count.get())</div>
        })
    }

    https://tokio.rs/blog/2026-09-24-topcoat-server-applications

    Запостил: ISO, 25 Сентября 2026

    Комментарии (4) RSS

    • <?rs
          Всё «новое» — это хорошо забытое «старое».
      ?>
      Ответить
      • Именно поэтому я за
        Ответить
      • это еще шоблон судя по impl, лол, их миллион намономорфироваться может

        Это такой реакт как я опнима, судя по
        // During the initial page load, only render once.
                    if !connected(cx) {
                        break Ok(token);
                    }
        Ответить
      • А будет ошибка
        &lt;A Href=&quot;Notice: foo can&#039;t be borrowed mutable, already borrowed here&quot;

        ?
        Ответить

    Добавить комментарий