1 line
1.6 KiB
HTML
1 line
1.6 KiB
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Document</title> <script src="dist/copy.js"></script> <script src="dist/select.js"></script> <script src="dist/form.js"></script> <script src="dist/popup.js"></script> <script src="dist/switch.js"></script> <script src="dist/checkbox.js"></script> <script src="dist/radio.js"></script> <script src="dist/input.js"></script> <script src="dist/textarea.js"></script> <script src="dist/text-field.js"></script> <script src="dist/button.js"></script> <script src="dist/menu.js"></script> <script src="dist/cube-loader.js"></script> <script src="dist/tags-input.js"></script> <script src="dist/strip-select.js"></script> <script src="dist/collapsed-text.js"></script> <script src="dist/notifications.js"></script> <script src="dist/syntax-highlighter.js"></script> <link rel="stylesheet" href="css/main.min.css"> <style>div{display:flex;padding:4vmax}body{overflow:auto}</style> </head> <body> <syntax-highlighter language="html"> <sm-copy value="hi dhf jsbdjf sjdb"> <sm-button> hi </sm-button> </sm-copy> </syntax-highlighter> <script>let currentSubscriber=null;function $signal(n){let r=n;const c=new Set;return[function(){if(currentSubscriber){const n=new WeakRef({func:currentSubscriber});c.add(n)}return r},function(n){if(n!==r){r=n;for(const n of c){const r=n.deref();r&&r.func()}}}]}async function $effect(n){currentSubscriber=n;const r=n();try{r instanceof Promise&&await r}catch(n){console.error(n)}finally{currentSubscriber=null}}</script> |