Get started with depot CDN
MIT licensed
Depot is a lightweight library for managing and serving client-side components.
Tags:- depot
Stable version
Copied!
How to start using depot CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with depot CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/depot/0.1.6/depot.min.js"></script>
</head>
<body>
<button id="myButton">Click me</button>
<script>
const { Component, h } = depot;
const MyButton = Component(({ onClick }) => {
return h('button', { onClick }, 'Click me');
});
document.getElementById('myButton').replaceWith(h(MyButton, { onClick: () => alert('Hello, world!') }));
</script>
</body>
</html>
Copied!
Copied!