This feature is experimental. It may be changed or removed in a future version.
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.
There is also a low-level up.network.abort()
function, which aborts requests
matching arbitrary conditions.
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' })
The element for which requests should be aborted.
May be omitted with { layer }
option.
The layer for which requests should be aborted.
May be omitted with element
argument.
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.
If omitted a default message will describe the abort conditions.
A request that should not be aborted, even if it matches the conditions above.