# ComparativeFetchMixin

Auto-generated from the @jbrowse/mobx-state-tree model in the source. See the [developer guide](https://jbrowse.org/jb2/docs/developer_guide/) for concepts. Built into JBrowse core. [View source](https://github.com/GMOD/jbrowse-components/blob/main/packages/synteny-core/src/ComparativeFetchMixin.ts).

The fetch foundation of the two comparative displays (LinearSyntenyDisplay,
DotplotDisplay): `KeyedFetchMixin` — `FetchMixin`'s rotation, loading flag,
error, status, durable cancel and retry, plus the `currentFetchKey` /
`loadedFetchKey` freshness pair the LGV global family runs on — and, on top,
the two-way loading answer a shared canvas wants — `loading` off the
`fetchLanded` hook, `refetching` off `isLoading` — and the one-shot
reversed-assembly flag.

`FetchMixin` is the one declaration site for `error`, a `BaseDisplay`
volatile the four flags below read. Declaring a second one to make them
type-check is the ADR-041 hazard, and `FetchMixin` already wins that
compose, so composing it lets the flags be getters here.

`loading` and `refetching` are different questions, and the difference
selects a full overlay or a corner chip (`ComparativeFetchStatus`). `displayPhase` stays per display — it reads the
shared canvas's `surfaceReadiness`, which each view publishes differently —
through `comparativeDisplayPhase`.

Each section ends with the members a composed model contributes, linked to the page that documents them.

## Volatiles

| Member | Description |
| --- | --- |
| **assembliesSwapped**<br><code>boolean</code> | Set once at view load by a refName-comparison check, independent of the per-render fetch, so it never re-fires or misfires on zoom. Surfaces through each display's `warnings`. |

10 inherited volatiles from 2 models:

From [KeyedFetchMixin](../keyedfetchmixin): [`loadedFetchKey`](../keyedfetchmixin#volatile-loadedfetchkey)

From [FetchMixin](../fetchmixin): [`activeSignal`](../fetchmixin#volatile-activesignal), [`fetchGeneration`](../fetchmixin#volatile-fetchgeneration), [`reloadCounter`](../fetchmixin#volatile-reloadcounter), [`statusWindow`](../fetchmixin#volatile-statuswindow), [`error`](../fetchmixin#volatile-error), [`statusMessage`](../fetchmixin#volatile-statusmessage), [`statusProgress`](../fetchmixin#volatile-statusprogress), [`fetchCanceled`](../fetchmixin#volatile-fetchcanceled), [`fetchRotation`](../fetchmixin#volatile-fetchrotation)


## Getters

| Member | Description |
| --- | --- |
| **fetchLanded**<br><code>boolean</code> | Overridable hook (default false): a fetch has completed and data is present, even if it mapped zero features. Not a feature-count test — an empty-but-finished fetch has landed, or an empty plot spins its overlay forever. Each display answers from a field of its payload, which survives a `reload()` where `loadedFetchKey` does not, so a retry shows the corner chip rather than the full overlay.<br><br>Default false is the strict answer — a display that forgets the override shows its first-load overlay forever (diagnosable) rather than reporting done over an empty plot. |
| **hasDrawable**<br><code>boolean</code> | Overridable hook: the display holds something an SVG export can draw. Defaults to `fetchLanded`; the dotplot answers with its instance geometry rather than its `geometry` computed, because `svgReady` is polled outside any reactive context and a `geometry` read there recolors every segment per poll. |
| **loading**<br><code>boolean</code> | First load, nothing on screen yet: drives the full striped overlay. Deliberately not `&& isLoading`, which would blink the overlay off during the pre-fetch debounce gap. Excludes `error` so error UI and loading UI never show at once, and `fetchInert` so a display that will never fetch rests instead of spinning on data that is not coming. |
| **refetching**<br><code>boolean</code> | A fetch is running over a stale plot still on screen (zoom, reorder, pan past the buffer): drives a corner indicator rather than the full overlay, so a viewport change does not mask what is drawn. |
| **svgReady**<br><code>boolean</code> | Off-screen SVG export gate, the shared `computeSvgReady` policy every display runs. Neither comparative display has a `regionTooLarge` state (LOD gates the fetch, not region size). `fetchInert` is the extra terminal, so an export cannot hang on data the autorun will never fetch, and `fetchCanceled` is terminal for the same reason: durable until Retry, and an export presses nothing. The data half waits out an in-flight same-key retry (`!refetching`) and a stale plot (`dataCurrent`). |

10 inherited getters from 2 models:

From [KeyedFetchMixin](../keyedfetchmixin): [`viewSignature`](../keyedfetchmixin#getter-viewsignature), [`dataSuperseded`](../keyedfetchmixin#getter-datasuperseded), [`currentFetchKey`](../keyedfetchmixin#getter-currentfetchkey), [`dataCurrent`](../keyedfetchmixin#getter-datacurrent)

From [FetchMixin](../fetchmixin): [`isLoading`](../fetchmixin#getter-isloading), [`isLoadingOrCanceled`](../fetchmixin#getter-isloadingorcanceled), [`fetchInert`](../fetchmixin#getter-fetchinert), [`awaitingPrerequisite`](../fetchmixin#getter-awaitingprerequisite), [`awaitingDependentData`](../fetchmixin#getter-awaitingdependentdata), [`settingsFetchInputs`](../fetchmixin#getter-settingsfetchinputs)


## Actions

| Member | Description |
| --- | --- |
| **setAssembliesSwapped**<br><code>(arg: boolean) =&gt; void</code> |  |

12 inherited actions from 2 models:

From [KeyedFetchMixin](../keyedfetchmixin): [`commitFetchResult`](../keyedfetchmixin#action-commitfetchresult), [`reload`](../keyedfetchmixin#action-reload)

From [FetchMixin](../fetchmixin): [`setError`](../fetchmixin#action-seterror), [`setStatusMessage`](../fetchmixin#action-setstatusmessage), [`stopActiveFetch`](../fetchmixin#action-stopactivefetch), [`openStatusStream`](../fetchmixin#action-openstatusstream), [`cancelFetch`](../fetchmixin#action-cancelfetch), [`cancelFetchByUser`](../fetchmixin#action-cancelfetchbyuser), [`beforeDestroy`](../fetchmixin#action-beforedestroy), [`beginFetch`](../fetchmixin#action-beginfetch), [`endFetch`](../fetchmixin#action-endfetch), [`runFetch`](../fetchmixin#action-runfetch)


