docs(kanban): use generated keyed commands
Keep the north-star kanban sketches aligned with the generated lower-aware append/replace helpers instead of teaching keyed slot extension methods. req: dx/006 req: codegen/002
This commit is contained in:
+4
-4
@@ -92,7 +92,7 @@ slhx reads this from hemplate Surface facts and generates scoped typed resources
|
|||||||
```rust
|
```rust
|
||||||
use ui::board::{forms, slots};
|
use ui::board::{forms, slots};
|
||||||
|
|
||||||
slots::card.replace(card.id, CardView::from(card));
|
ui::board::replace(slots::card, card.id, &CardView::from(card));
|
||||||
forms::create_card.clear("title");
|
forms::create_card.clear("title");
|
||||||
ui::render(&BoardView::from(board));
|
ui::render(&BoardView::from(board));
|
||||||
```
|
```
|
||||||
@@ -135,7 +135,7 @@ pub fn create_card(
|
|||||||
app.board.update(|board| board.insert_card(form.column, card.clone()));
|
app.board.update(|board| board.insert_card(form.column, card.clone()));
|
||||||
|
|
||||||
(
|
(
|
||||||
slots::card.append(card.id, &CardView::from(card)),
|
ui::board::append(slots::card, card.id, &CardView::from(card)),
|
||||||
forms::create_card.clear("title"),
|
forms::create_card.clear("title"),
|
||||||
// slhx-sync: queue atomic board state diff for sync
|
// slhx-sync: queue atomic board state diff for sync
|
||||||
SyncEffect::send_patch(atoms::board, Patch::insert_card(form.column, card)),
|
SyncEffect::send_patch(atoms::board, Patch::insert_card(form.column, card)),
|
||||||
@@ -233,7 +233,7 @@ pub fn apply_board_patch(
|
|||||||
Effect::broadcast(
|
Effect::broadcast(
|
||||||
Channel::Board(app.board.id()),
|
Channel::Board(app.board.id()),
|
||||||
Effect::batch(changed_cards.into_iter().map(|c|
|
Effect::batch(changed_cards.into_iter().map(|c|
|
||||||
slots::card.replace(c.id, &CardView::from(c))
|
ui::board::replace(slots::card, c.id, &CardView::from(c))
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
@@ -255,7 +255,7 @@ Server-authoritative on conflict. No Redux sagas. No React Query cache fades.
|
|||||||
```rust
|
```rust
|
||||||
#[slhx_sync::presence]
|
#[slhx_sync::presence]
|
||||||
pub fn user_joined(user: UserPresence) -> impl IntoEffect {
|
pub fn user_joined(user: UserPresence) -> impl IntoEffect {
|
||||||
slots::presence_user.append(user.id, &PresenceBadge::from(user))
|
ui::board::append(slots::presence_user, user.id, &PresenceBadge::from(user))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user