using Statum; using Invercargill; using Invercargill.DataStructures; namespace Example { /** * Entrypoint for the home page: hydrates a `counter` slot the template binds * to with `stm-text="counter.value"`. */ public class HomeEntrypoint : StatumEntrypoint { public override async Lot handle() throws GLib.Error { var directives = new Series(); var counter_public = new PropertyDictionary(); counter_public.set_native("value", 42); var counter_state = new State() { type_name = "counter", public_data = counter_public, private_data = new PropertyDictionary() }; var counter_slot = state_service.new_slot(Scope.PAGE, counter_state); var counter_frame = state_service.sign_slot(counter_slot.id); directives.add(new Model.SetDirectiveDto.with_frame((!)counter_frame)); return directives; } } }