Aborts requests targeting a fragment or layer.
Always emits the event up:fragment:aborted
, regardless of whether there were requests to abort.
If a request was aborted, the event up:request:aborted
will also be emitted.
To abort pending requests targeting an element or its descendants, pass a reference or CSS selector for that element:
up.fragment.abort(element)
up.fragment.abort('.foo')
You may also pass an { origin }
or { layer }
option to help look up the selector.
To abort all requests targeting elements on a given layer,
pass a { layer }
option:
up.fragment.abort({ layer: 'root' })
This would abort requests targeting any elements on any layer:
up.fragment.abort({ layer: 'any' })
There is also a low-level up.network.abort()
function, which aborts requests
matching arbitrary conditions.
If possible, prefer up.fragment.abort()
, which matches requests by screen region.
Only when requests are aborted by screen region, components
can react to being aborted.
The element causing requests to be aborted.
This is used to look up an element
selector or { layer }
name.
The reason for aborting requests.
The promise by an aborted up.request()
will reject with this reason
to help debugging an unexpected aborting.
If omitted, a default message will describe the abort conditions.