@ignis-web/turbo-html
v2.2.0
Published
[![Actions Status](https://github.com/dm-kamaev/turbo-html/workflows/Build/badge.svg)](https://github.com/dm-kamaev/turbo-html/actions) ![Coverage](https://github.com/dm-kamaev/turbo-html/blob/master/badges/coverage.svg)
Downloads
12
Maintainers
Readme
Turbo Html
In browser:
import TurboHtml from '@ignis-web/turbo-html/client';
// on server-side (Node js)
// import { commands } from '@ignis-web/turbo-html/commands';
new TurboHtml({
onError(err) {
console.log('Request error', err, JSON.stringify(err));
},
requestTimeout: 10000,
onLongRequest: {
start() {
console.log('Show Loader');
document.querySelector('.global-spinner').style.display = 'flex';
},
end() {
document.querySelector('.global-spinner').style.display = 'none';
console.log('End Loader');
}
}
});
<script src="https://cdn.jsdelivr.net/gh/dm-kamaev/turbo-html/turbo-html/index.ts"></script>
<script src="https://cdn.jsdelivr.net/gh/dm-kamaev/[email protected]/client/index.js"></script>
<script>
new TurboHtml({
onError(err) {
console.log('Request error', err, JSON.stringify(err));
},
requestTimeout: 10000,
onLongRequest: {
start() {
console.log('Show Loader');
document.querySelector('.global-spinner').style.display = 'flex';
},
end() {
document.querySelector('.global-spinner').style.display = 'none';
console.log('End Loader');
}
}
});
</script>