| 123456789101112131415161718192021222324252627282930 |
- 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<Model.DirectiveDto> handle() throws GLib.Error {
- var directives = new Series<Model.DirectiveDto>();
- var counter_public = new PropertyDictionary();
- counter_public.set_native<int>("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;
- }
- }
- }
|