I'd like to have something like a signal that reads the current date:
dateTimeWidg :: Widget HTML DateTime
dateTimeWidg = liftEffect nowDateTime
dateTimeSig :: Signal HTML DateTime
dateTimeSig = sig initDate
where
sig dt = step dt do
newDt <- dateTimeWidg
pure $ sig newDt
The widget seems fine, however, the signal creates an infinite (eagerly evaluated) loop, since dateTimWidg returns immediately.
Ideally, there would be a way to have dateTimeSig only queried when other signals at the same level fire. The particular goal here is that I have user's inputting data to records, but this particular field of the record should be automatically timestamped by the app.
I'd like to have something like a signal that reads the current date:
The widget seems fine, however, the signal creates an infinite (eagerly evaluated) loop, since
dateTimWidgreturns immediately.Ideally, there would be a way to have
dateTimeSigonly queried when other signals at the same level fire. The particular goal here is that I have user's inputting data to records, but this particular field of the record should be automatically timestamped by the app.