package miaou-core
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Miaou core/widgets (no drivers, no SDL)
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou-core.core/Miaou_core/Navigation/index.html
Module Miaou_core.NavigationSource
Page state wrapper with navigation support.
Instead of pages manually managing a next_page field, the framework wraps page state in 'a t and provides navigation helpers.
Usage in pages
let handle_key ps key ~size =
match key with
| "Esc" -> Navigation.back ps
| "q" -> Navigation.quit ps
| "Enter" -> Navigation.goto "other_page" ps
| "j" -> Navigation.update (fun s -> {s with cursor = s.cursor + 1}) ps
| _ -> psType-safe navigation
Navigation uses a variant type to prevent common mistakes:
Goto "page"pushes the current page onto the history stack and navigates to the named page.Backpops the previous page from the history stack.Quitexits the application.
Using a variant instead of magic strings makes it impossible to accidentally use goto "parent_page" when back is intended, which previously caused infinite navigation loops.
Navigation target.
pending ps returns the pending navigation target, if any. Used by the framework after handlers return.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page