New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@epigraph/spinner

Package Overview
Dependencies
Maintainers
6
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epigraph/spinner

The Epigraph Spinner web component

latest
npmnpm
Version
1.1.4
Version published
Weekly downloads
20
Maintainers
6
Weekly downloads
 
Created
Source

Import

You need to import our web component module. We recommend that you do this in the head. It's important that type="module" is specified.

Example

<head>
  <script type="module" async src="https://www.unpkg.com/@epigraph/spinner/dist/epigraph-spinner.min.js"></script>
</head>

Usage

You can insert epigraph-spinner elements anywhere you'd like. Epigraph Spinner currently serves one purpose: to embed a spinner directly in your page.

Attributes

NameTypeDefault ValueDescription
skuString, required"null"Insert your product code/item no. for specifying which spinner to load (from our DB). This is a reactive attribute, so changing the sku attribute will force a spinner reload.
ua-codeString, required""Insert your ua-code for google analytics in order to send analytics event to your dashboard.

Example: Spinner for all platforms

<epigraph-spinner sku="abc123" ua-code="valid-ua-code"></epigraph-spinner>

Events (with example usage)

"epigraph-valid-product"

You can register to this event from <epigraph-spinner> to know when <epigraph-spinner> has successfully fetched a valid product. You can leverage this event to enable custom actions that should only happen for products with epigraph spinners.

// target <epigraph-spinner>
const eSpin = document.querySelector('epigraph-spinner');

// add the event listener
eSpin.addEventListener('epigraph-valid-product', () => {
  // do something
})

"epigraph-invalid-product"

You can register to this event from <epigraph-spinner> to know if <epigraph-spinner> has failed to fetch a valid product.

// target <epigraph-spinner>
const eSpin = document.querySelector('epigraph-spinner');

// add the event listener
eSpin.addEventListener('epigraph-invalid-product', () => {
  // do something
})

Methods

NameDescription
load()Call this method to set spinner loading to start immediately

Keywords

web-components

FAQs

Package last updated on 06 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts