Re-triggering the update is now done globally again with lock on
ticker level to avoid concurrent updates.
If a tick with a known ID is received, the markup is now updated, so no
duplicates should appear.
The prepend() function used to update the markup is replaced by
insertBefore() for Internet Explorer compatibility.
Query new ticks using GET request to the REST API.
Also we now trigger one request per ticker, if more than one is
available on the same page.
HTML markup (list element, content container) is generated client side,
s.t. we can work on the generic response data model
Replacing the body by prepending HTML results in the full content
being re-rendered. This can be a performance issue, but is definitely
annoying when embedding media in ticks.
There are polyfills for methods like apiFetch, so migrate the syntax to
ES5 (no generators, method shorthands, arrow functions, ...) and we are
done here without adding transpilers to the project.
When a ticker is added by a Gutenberg block, it is initially empty. This
can be detected by checking the "last" flag for 0 value. If found, the
ticker is now updated immediately by the AJAX function and not waiting
for the poll interval to trigger.