Fork me on GitHub
#rum
<
2019-02-14
>
mattly01:02:55

Maybe have an fx that does delayed dispatching from your initial event to update the state later

mattly01:02:45

Alternately, if you need the concept of a clock in your app, just have a current time value in your state that gets updated from a setInterval and then add a delete at key to those things

mattly01:02:53

But the first is conceptually simpler

mattly01:02:51

You could also delve into one of the react animation libraries and just have a super sharp transition after a delay

mattly01:02:16

Or if you’re on cutting edge react something with useState

mattly01:02:15

Personally I’ve used the “delayed dispatch” pattern a lot and it’s pretty flexible

pez07:02:15

I use delayed dispatch as a side effect in other places in the app. I'd like to use that here as well. However, I do not find a clean place to do it here. The individual state updates are unaware of this need at the moment. They just update their things and then this view sort of have two ”versions” that depend on some specific subset and combination of those things. So I have a function like (defn have-all-things? [state] ... and on the result of that I determine which version to display. Maybe I do need to add something that is aware of this subset/combination of things into the the state updates...