Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
mkSaveSettings :: (TimeUnit t, ToJSON s) => t -> FilePath -> IO (s -> IO ()) Source
Prepare a save action which writes settings into a JSON file. This action defers the work to a separate dedicated thread, and ensures the file isn't saved more than once within the given time interval.
The action is non-blocking but there is a chance a save is missed if saves are triggered
You can call the returned action from your UI thread as a reaction to a settings change, without worrying about delay or IO load.