JSPM

request-stripe

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 82
  • Score
    100M100P100Q76128F
  • License MIT

🌈 The tiny library for rendering a progress bar on top your screen

Package Exports

  • request-stripe
  • request-stripe/request-stripe

Readme

npm-version

request-stripe

🌈 The tiny library for rendering a progress bar on top your screen.

Features

  • 📦 Zero dependencies
  • 🕯 Framework agnostic, using vanila API
  • 🗜 Less 3 KB
  • 🔨 Tiny API
  • ⚙️ Customize render and styles
  • 🧲 Autocombine requests

Getting Started

npm install request-stripe
import { requestStripe } from 'request-stripe';

fetch().finally(requestStripe());
// or
const done = requestStripe();
fetch().finally(() => {
  done();
});

Customization

Styles

.request-stripe-custom {
  color: #e11d48;
  animation-name: custom-process, custom-finish;
  animation-...
}

.request-stripe-custom[data-state='process'] {
  animation-play-state: running, paused;
}

.request-stripe-custom[data-state='finish'] {
  animation-play-state: paused, running;
}

@keyframes custom-process {
  ...
}

@keyframes custom-finish {
  ...
}

Render

import { Render, requestStripe } from 'request-stripe';

// Write a render function
const customRender: Render = () => {
  const customElement = document.createElement('div');
  document.body.appendChild(customElement);

  return () => {
    document.body.removeChild(stripeElement);
  };
};

// Pass the function
const done = requestStripe(customRender);
fetch().finally(done);