← all modules

Std.Watch

Std.Watch
  Std.Watch — file-system change notification (Linux and macOS).

Types
  type Watcher
  type Change = Created String | Modified String | Removed String | Renamed String String | Overflow
  type alias Options = { recursive : Bool , debounceMs : Int , ignore : List String }

Values
  changes : Watcher -> (List Change -> msg) -> Sub msg
      A subscription that delivers each batch as one Msg.
  close : Watcher -> Task Error ()
      Stop watching. Idempotent.
  defaultOptions : Options
      Not recursive, a 50 ms debounce window, nothing ignored.
  next : Watcher -> Task Error (List Change)
      Wait for the next batch of changes. A `next` that is waiting when the
  watch : List String -> Options -> Task Error Watcher
      `watch paths options` — start watching. Each path is a directory or a
  withDebounce : Int -> Options -> Options
      The quiet time in milliseconds before a batch is delivered.
  withIgnore : List String -> Options -> Options
      Paths to leave out (see the module notes for the pattern rules).
  withRecursive : Bool -> Options -> Options
      Watch every directory below a watched directory, including ones created