Liking cljdoc? Tell your friends :D

hyper.watch

Internal-state reactivity for hyper tabs.

Two responsibilities live here:

  • The app-state watcher (setup-watchers!): a single watch on app-state* that triggers a re-render when this tab's global / session / tab / route / signal state changes. This is the cursor & signal reactivity primitive.

  • Source reference counting (retain-source! / release-source!): shared by hyper.subview, which now owns ALL external-source watching (reactive regions, user h/watch!, route-level :watches, and the framework routes/head Var + component-registry watches). When the last consumer releases a source its -dispose is called.

Internal-state reactivity for hyper tabs.

Two responsibilities live here:

- The **app-state watcher** (`setup-watchers!`): a single watch on
  `app-state*` that triggers a re-render when this tab's global / session /
  tab / route / signal state changes.  This is the cursor & signal
  reactivity primitive.

- **Source reference counting** (`retain-source!` / `release-source!`):
  shared by `hyper.subview`, which now owns ALL external-source watching
  (reactive regions, user `h/watch!`, route-level `:watches`, and the
  framework routes/head Var + component-registry watches).  When the last
  consumer releases a source its `-dispose` is called.
raw docstring

release-source!clj

(release-source! app-state* source)

Decrement the reference count for a watched source. When the count reaches zero, calls -dispose and removes the refcount entry.

Decrement the reference count for a watched source.  When the count
reaches zero, calls -dispose and removes the refcount entry.
sourceraw docstring

remove-watchers!clj

(remove-watchers! app-state* tab-id)

Remove the app-state watcher for a tab.

Remove the app-state watcher for a tab.
sourceraw docstring

retain-source!clj

(retain-source! app-state* source)

Increment the reference count for a watched source.

Increment the reference count for a watched source.
sourceraw docstring

setup-watchers!clj

(setup-watchers! app-state* session-id tab-id trigger-render!)

Setup a single watcher on app-state that triggers re-renders when global, session, tab, route, or signal state changes for this tab. Route URL sync is handled client-side via MutationObserver on data-hyper-url.

External-source watches (routes/head Vars, component registry, user h/watch!, route-level :watches) are not managed here — they are subviews (see hyper.subview), wired/torn down through the subview lifecycle.

Setup a single watcher on app-state that triggers re-renders when
global, session, tab, route, or signal state changes for this tab.
Route URL sync is handled client-side via MutationObserver on data-hyper-url.

External-source watches (routes/head Vars, component registry, user
`h/watch!`, route-level `:watches`) are not managed here — they are subviews
(see `hyper.subview`), wired/torn down through the subview lifecycle.
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