RefreshButton Component ReferenceButton Component Referencetml`<RefreshButton spinner=metar btnId=metarRefresh onclick=${() => ...}/>`
The RefreshButton component renders a Button containing the &sync; character entity symbol. The symbol spins while the named spinner of the page the button is on is running.
The page starts and stops a spinner with ctl.page(pageId).startSpinner(name) and stopSpinner(name), where name matches the button's spinner attribute. When the button mounts, it registers itself with its page by calling the page's registerSpinner() method and unregisters in willUnmount() with unregisterSpinner(). The page keeps the spin state, not the button, so if the button is re-rendered while a fetch is in progress, it asks the page's isSpinning() method and continues to spin. The page is taken from the component's contextProps.pageId.
spinner (required)'metar'. A page can have several, each named for the thing being refreshed.onclick (required)btnId (optional)Button.className (optional)All other attributes are passed to the Button component.
showSpinning()showSpinning(isSpinning)
Starts or stops the symbol spinning by toggling the refreshSpin class on the refreshSymbol element. Called by the page when the state of its named spinner changes. This is not normally called by other code.
isSpinningThe RefreshButton component ignores all children.
RefreshButton Component will render a <button> containing a <span class=refreshSymbol> that holds the &sync; symbol.