Re: [elm-discuss] How to model a transient state?

2016-10-20 Thread Jacky
Thanks! "Marked" is clearer and reflect what's happening on the screen. On Fri, Oct 21, 2016 at 3:55 AM, Nick H wrote: > What if you added a third value to the ReadState type? > > type ReadState = Read | Unread | Marked > > Then your filtered view will show both Unread and Marked. When the user

Re: [elm-discuss] How to model a transient state?

2016-10-20 Thread Nick H
What if you added a third value to the ReadState type? type ReadState = Read | Unread | Marked Then your filtered view will show both Unread and Marked. When the user refreshes, you can map all the Marked items to Read. On Thu, Oct 20, 2016 at 12:43 AM, Jacky See wrote: > My current approach i

Re: [elm-discuss] How to model a transient state?

2016-10-20 Thread Jacky See
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 the Google Groups "Elm Discuss" g

Re: [elm-discuss] How to model a transient state?

2016-10-18 Thread Mark Hamburg
If items had identifiers, then I would have some notion of an optional current item in the model or an "except this item" in the filter portion of the model and then have the filter not remove the current item. This can be extended to handle sets of selected items in a natural way. Basically, you w