Vanilla web component wrapper around the native fetch API, inspired by Polymer's iron-ajax but with zero legacy dependencies and full ES6 module support. Current stable version is 0.0.108, with frequent updates. Key differentiators: lightweight (~2KB minzipped), works with any framework or no framework, supports Polymer-style template bindings, debouncing, base URL via link rel=preconnect, and a lite variant for minimal overhead. Breaks down into three subcomponents (xtal-fetch-lite, xtal-fetch, xtal-fetch.js) to reduce bundle size. Ships TypeScript types.
npm install xtal-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: import via side-effect, set attributes for fetch request, and listen for result-changed event to access data.
Always include fetch attribute (or set .fetch property to truthy) on the element.
Do not manually define the element; rely on side-effect import.
Use import or script with type=module.
Use the full xtal-fetch or attach an error event listener if using lite.
Ensure disable is falsy when intending to make requests.
Use version locking or test before upgrading.
Remove customElements.define('xtal-fetch', ...) call. The component auto-registers.Add fetch attribute: <xtal-fetch fetch href="..."> or set element.fetch = true.
Ensure the event listener is attached after the element is connected to DOM and request completed. Check that 'as' attribute is correctly set.
Ensure there is a <link rel="preconnect" id="myBase" href="https://api.example.com/"> in the document head.
Use correct import: import 'xtal-fetch/xtal-fetch.js'; for ES modules.
No dependency data recorded yet.