Pages and update functions can run side effects before rendering. Here we use a Reader (TVar Int)
to track the count
-
Uses a view function to render the state:
viewCount :: Int -> View Counter ()
Notice how the view function expects the current count as a parameter
View Source