Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Debouncer k
- registerEvent :: Debouncer k -> Seconds -> k -> IO () -> IO ()
- newAsyncDebouncer :: (Eq k, Hashable k) => IO (Debouncer k)
- noopDebouncer :: Debouncer k
Documentation
A debouncer can be used to avoid triggering many events (e.g. diagnostics) for the same key (e.g. the same file) within a short timeframe. This is accomplished by delaying each event for a given time. If another event is registered for the same key within that timeframe, only the new event will fire.
We abstract over the debouncer used so we an use a proper debouncer in the IDE but disable debouncing in the DAML CLI compiler.
newAsyncDebouncer :: (Eq k, Hashable k) => IO (Debouncer k) Source #
Debouncer used in the IDE that delays events as expected.
noopDebouncer :: Debouncer k Source #
Debouncer used in the DAML CLI compiler that emits events immediately.