-
Notifications
You must be signed in to change notification settings - Fork 526
Open
Description
In the code as supplied here, each page needs to have a toSession
method exposed that essentially just returns the session field out of its model. Why not make this more generic?
getSession: { a | session: Session } -> Session
getSession =
session
Then you can replace the calls in the case
statement:
...
Home home ->
Home.toSession home
Settings settings ->
Settings.toSession settings
with
...
Home home ->
getSession home
Settings settings ->
getSession settings
And there is no longer a need to have a toSession
in the pages, unless you want it.
Metadata
Metadata
Assignees
Labels
No labels