Documentation
¶
Overview ¶
Package replace demonstrates screen.Replace — atomic top-of-stack swap.
Two screens, each with mutable state the user can see change:
cityList: a filterable list of cities. The filter and cursor are state.
Press r → Replace with a fresh cityList. Filter clears, cursor
jumps to top, breadcrumb depth stays at 1 (no flicker).
cityDetail: pushed via enter on the list. Holds a visit counter that
bumps on `+`. Press r → Replace with a fresh cityDetail for
the same city. Counter resets to 0; the cityList beneath
stays put — its OnEnter does NOT fire (which is the whole
point: pop+push would fire it on the parent).
Compare against pop+push, which would (a) flicker visibly between frames and (b) call OnEnter on the parent that briefly becomes the top, often retriggering side effects (refetch, scroll-to-cursor, …).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.