upsiflu / less-ui

Write your views across several screen regions, and hide all Ui state in the Url.
https://package.elm-lang.org/packages/upsiflu/less-ui/latest
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Replace `State` module by `Link` #32

Closed upsiflu closed 1 year ago

upsiflu commented 1 year ago

Motivation For the user, Ui, application and Link are the relevant Apis for construction. State is never constructed, and only stored in an application as a Url. As any Url is a valid State, we do a type alias.

Link.applyTo : State -> Link -> State

instead of

State.next : Link -> State -> State
upsiflu commented 1 year ago

Goal

Going with #29, State should not be a module because we don't treat it as a permanent data type. Instead, it is a collection of functions that map to and from the Url.

Situation now (Sept 5, 2023)

What does the Url map to and from?

Where is State used?

Here are all Url-centric functions from the current State module. I excluded the Link-centric functions.

Create

Map

Query

Deconstruct