feat(slhx): prefer render methods for views
Move view rendering onto Slot::render and KeyedSlot append/prepend/replace extension methods, leaving explicit text/html methods for non-view escape hatches. req: codegen/002 req: view/001
This commit is contained in:
@@ -11,9 +11,9 @@ fn effect_batch_wire_round_trips() {
|
||||
let user = Atom::<String>::new(3);
|
||||
|
||||
let batch = (
|
||||
count.render(2),
|
||||
todos.append(7, String::from("Buy milk")),
|
||||
todos.replace(7, String::from("Buy oat milk")),
|
||||
count.text(2),
|
||||
todos.append_text(7, String::from("Buy milk")),
|
||||
todos.replace_text(7, String::from("Buy oat milk")),
|
||||
user.set("Ada"),
|
||||
navigate("/todos"),
|
||||
event("toast", "Saved"),
|
||||
@@ -32,7 +32,7 @@ fn effect_batch_wire_round_trips() {
|
||||
fn keyed_slot_replace_uses_scoped_resource_ref() {
|
||||
let todos = KeyedSlot::<u64, String>::new(9);
|
||||
// req: codegen/002
|
||||
let effect = todos.replace(12, String::from("done"));
|
||||
let effect = todos.replace_text(12, String::from("done"));
|
||||
|
||||
let Effect::Put { target, payload } = effect else {
|
||||
panic!("expected Put");
|
||||
|
||||
Reference in New Issue
Block a user