type alias Item = { text : String, readState : ReadState, ... }
type ReadState = Read | Unread
type alias Model = { items : List Item }
In the item list view, there is a filter switch: All or Unread.
When the 'Unread' switch is on, it lists all unread items.
Item can be marked as 'Read' by clicking on a item's button,
but then the item immediately disappeared from the filtered list view,
which brings bad user experience.
I'm thinking how should I model such that the just clicked 'unread'
item remains on the filtered list until some other refresh happen?
How to model this 'to be Read' state?
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
My current approach is to have a `readStateToBe` which contains the pending update state.
and 'flush update' (write `readStateToBe` to `readState`) on appropriate update branch (e.g. switching filter).
--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/r1oWcVL95Fs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss+unsubscribe@googlegroups.com.