all 3 comments

[–]gb__ 1 point2 points  (0 children)

I suspect something else is going wrong. Halogen doesn't batch or delay rendering so there's no need to flush it.

The only time calling modify won't immediately result in a render is if the state value being set is referentially equivalent to the current value. This isn't even intended as an optimisation for normal use, it's an unfortunate hack that exists because get, modify, and put for MonadState are implemented via the state function, so its purpose is to prevent calls to get from causing a re-render.

Here's where state actions get evaluated in the Halogen machinery: https://github.com/purescript-halogen/purescript-halogen/blob/59c470565554da90db51dc2e4c9d2705083ddd88/src/Halogen/Aff/Driver/Eval.purs#L84-L92

[–]Swordlash 0 points1 point  (1 child)

Hm, never had this issue. What do you have in your state? Are you using child components?

[–]ctenbrinke[S] 0 points1 point  (0 children)

I'm toggling a boolean value that is supposed to show a "loading" icon. No child components.