Primitives / State

foldkit-primitives/state

Application state with nowhere else to live: the current page, the undo stack, the locale, a selection, a virtualized list's window. These bundles own the frame, not the contents; loading the rows stays the application's job. (source)

NameFormModelMessagesArgs
Paginationbundle{ page, perPage, total }GoToPage, NextPage, PrevPage, SetPerPage, SetTotal{ perPage, total? }
history({ name, value, capacity? })bundle factory{ past, present, future, group }Push { value, group? }, Undo, Redo, GoTo { step }, Clear{ initial }
History.*functionsthe same steps, pure
Localebundle{ locale }SetLocale{ default }
SelectionSetbundle{ selected }Select, Deselect, Toggle, ReplaceAll, Clearnone
Virtualbundlescroll, heights, layoutScrolled, Measured, Prune, Settledlayout args
Viewport, MeasureRow({ key })MountsViewportScrolled, RowMeasured
range(start, end, step?)function
windowFor, isAtEnd, distanceToEnd, offsetFor, stickyHeader, masonryfunctions

Persisted state lives one package over: Mirror.kv keeps a slice in Effect's KeyValueStore across reloads. Nothing here duplicates it.