@aamasri/busy
v1.2.5
Published
A beautiful animated loader with a js busy queuing system.
Downloads
40
Maintainers
Readme
- Download & copy this package's "dist" folder into your web server's public folder eg.
public/js/dist/*
. - Rename "dist" to "busy" eg.
public/js/busy
- Load the busy script at the end of your web page (before the closing
body
tag) like this:
<body>
...
<script src="/js/busy/busy.js"></script>
</body>
</html>
- When the browser loads, busy will be attached to the browser's global window object. Use it anywhere in your scripts like this:
<button>Target</button>
<script>
busy.start('test-1', 15); // start a loader
busy.start('test-2', 60); // register another loader
...
busy.stop('test-1'); // stop the specified loader
...
busy.reset(); // clear all loaders
</script>
Then import and use it in your project's ES6 modules:
function fetchDataFromApi() { busy.start('fetching data', 10, true); }
fetch(api....)
.then(data => {
busy.stop('loading');
...
})...
});
Busy supports npm under the name @aamasri/busy
.
Publishing Updates
- Ananda Masri
- And awesome contributors