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.
(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.
(remove-watchers! app-state* tab-id)Remove the app-state watcher for a tab.
Remove the app-state watcher for a tab.
(retain-source! app-state* source)Increment the reference count for a watched source.
Increment the reference count for a watched source.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |