Liking cljdoc? Tell your friends :D

hive-hot.debounce

Coordination-aware debouncing for hot-reload events.

Provides debouncing with claim-awareness:

  • Unclaimed files: time-based debounce (coalesce rapid changes)
  • Claimed files: buffer until claims released

Design: State-based debounce windows, not just time-based.

Coordination-aware debouncing for hot-reload events.

Provides debouncing with claim-awareness:
- Unclaimed files: time-based debounce (coalesce rapid changes)
- Claimed files: buffer until claims released

Design: State-based debounce windows, not just time-based.
raw docstring

create-debouncerclj

(create-debouncer callback
                  claim-checker
                  &
                  {:keys [cooldown-ms] :or {cooldown-ms 100}})

Create a new CoordinatingDebouncer.

Arguments:

  • callback: fn called with set of files to reload
  • claim-checker: fn that returns set of currently claimed files

Options:

  • :cooldown-ms - debounce window (default 100ms)
Create a new CoordinatingDebouncer.

Arguments:
- callback: fn called with set of files to reload
- claim-checker: fn that returns set of currently claimed files

Options:
- :cooldown-ms - debounce window (default 100ms)
sourceraw docstring

flush-pending!clj

(flush-pending! debouncer)

Force flush all pending files immediately.

Force flush all pending files immediately.
sourceraw docstring

handle-event!clj

(handle-event! debouncer {:keys [file type] :as _event})

Handle a file change event.

If file is claimed -> buffer in pending If file is unclaimed -> add to unclaimed set, schedule/reschedule debounce

Handle a file change event.

If file is claimed -> buffer in pending
If file is unclaimed -> add to unclaimed set, schedule/reschedule debounce
sourceraw docstring

on-claims-released!clj

(on-claims-released! debouncer released-files)

Called when file claims are released. Triggers reload of buffered files.

Called when file claims are released. Triggers reload of buffered files.
sourceraw docstring

pending-filesclj

(pending-files debouncer)

Get the set of files currently buffered (claimed).

Get the set of files currently buffered (claimed).
sourceraw docstring

stop-debouncer!clj

(stop-debouncer! debouncer)

Stop the debouncer and clean up resources.

Stop the debouncer and clean up resources.
sourceraw docstring

unclaimed-filesclj

(unclaimed-files debouncer)

Get the set of files awaiting debounce (unclaimed).

Get the set of files awaiting debounce (unclaimed).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close