Skip to content

faustienf/request-stripe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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 via .request-stripe-custom

.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);